Skip to content

Fixed #28462 -- Changed admin "POSTed bulk-edit data" to use ChangeList qs.#8837

Closed
blueyed wants to merge 1 commit into
django:masterfrom
blueyed:admin-changelist_view-use-cl-queryset
Closed

Fixed #28462 -- Changed admin "POSTed bulk-edit data" to use ChangeList qs.#8837
blueyed wants to merge 1 commit into
django:masterfrom
blueyed:admin-changelist_view-use-cl-queryset

Conversation

@blueyed

@blueyed blueyed commented Aug 1, 2017

Copy link
Copy Markdown
Contributor

This was changed in 917cc28 to use the model admin queryset, instead
of the ChangeList's result_list, but it seems to be more appropriate
to use the ChangeList's queryset here instead, like it is done in
changelist_view in general.

This was changed in 917cc28 to use the model admin queryset, instead
of the ChangeList's `result_list`, but it seems to be more appropriate
to use the ChangeList's queryset here instead, like it is done in
`changelist_view` in general.
@timgraham

Copy link
Copy Markdown
Member

I suppose a test is needed one way or another to show why this makes a difference. Don't forget that all fixes like this require a Trac ticket.

@blueyed

blueyed commented Aug 1, 2017

Copy link
Copy Markdown
Contributor Author

I just came across this, haven't checked the bug tracker.

917cc28 has a test that still is green, but a new test would be needed - probably based on the regressions reported in 917cc28#commitcomment-22253372.

blueyed referenced this pull request Aug 1, 2017
…rrent edits.

Allowed admin POSTed bulk-edit data to use modeladmin.get_queryset()
so that the ids in the POST data have a chance to match up even if
the objects on the current page changed based on the ordering.
@timgraham timgraham changed the title Changed admin "POSTed bulk-edit data" to use ChangeList qs. Fixed #28462 -- Changed admin "POSTed bulk-edit data" to use ChangeList qs. Aug 7, 2017
@inopia

inopia commented Aug 29, 2017

Copy link
Copy Markdown

This fixes the performance problem with list_editable on a large dataset for me.

@blueyed

blueyed commented Aug 29, 2017

Copy link
Copy Markdown
Contributor Author

Ticket: https://code.djangoproject.com/ticket/28462#ticket
Needs a test.

@timgraham

Copy link
Copy Markdown
Member

I think this reintroduces the possibility of concurrent editing problems. For example, if an object is edited from a page with list filter is applied, then cl.get_queryset(request) won't the object if a concurrent edit removes it from the filtered results.

@timgraham

Copy link
Copy Markdown
Member

Closing due to inactivity.

@timgraham timgraham closed this Jan 5, 2018
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

Successfully merging this pull request may close these issues.

3 participants