Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin: Issues when updating records through list_editable fields #798

Open
Palisand opened this issue Jul 4, 2019 · 4 comments
Open

Admin: Issues when updating records through list_editable fields #798

Palisand opened this issue Jul 4, 2019 · 4 comments

Comments

@Palisand
Copy link

Palisand commented Jul 4, 2019

I've encountered 3 issues involving multiple records being updated at the same time through the admin changelist page (through fields that are included in ModelAdmin.list_editable):

  1. The actions on history pages will be the same across all records in an update set, rather than being specific to each record. If you were to perform an update on distinct fields across multiple rows, the updates to the fields performed for the last row are the ones that will be listed on every record's history.
  2. Reverting one record via the admin interface will revert all records that were part of the same update (i.e. the same revision), and...
  3. ...the history of only one record will be updated (the revert row will only be present on the history page of the record that was used to perform the revert).

To reproduce this locally, you can follow the steps listed in a repo I created specifically for this ticket. It provides an example that showcases all of the issues mentioned above.

@etianen
Copy link
Owner

etianen commented Jul 5, 2019 via email

@Palisand
Copy link
Author

Palisand commented Jul 5, 2019

It would be cool if there was an option on the history page to either revert only one record or all records that were part of an update. I'm currently playing with this project's source; hopefully I'll have a PR ready in the near future. Awesome work by the way.

@Palisand
Copy link
Author

Palisand commented Jul 5, 2019

So VersionAdmin wraps ModelAdmin.changelist_view with the create_revision context manager. @etianen Is there a way to have 1 reversion created per save invocation rather 1 for all? I've got a nasty 🤢 way to do it: copy the contents of ModelAdmin.changelist_view into VersionAdmin.changelist_view and wrap the saving of resources with self.create_revision(request).

@etianen
Copy link
Owner

etianen commented Jul 9, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants