1

I want to ensure that a user editing a particular model is saved in that models updated_by (FK User) field.

I'm using mostly ModelForms (not necessarily the built in Admin), and wondering:

In what cases would I need to override ModelAdmin.save_model() or ModelAdmin.save_formset()?

Or, is that doing it wrong? If it's just the models' save() method that needs to be overridden, is there a proper way to access the request object there?

anonymous coward
  • 12,594
  • 13
  • 55
  • 97

1 Answers1

0

This was previously answer by Daniel Roseman over here.

If you want something that will work both in the admin and elsewhere, you should use a custom modelform.

He provides an example and points to this blog post by James Bennett.

Community
  • 1
  • 1
anonymous coward
  • 12,594
  • 13
  • 55
  • 97