#15742: Bug: Mark all does not contain full queryset when using intermidiate pages in Django admin -------------------------------------+------------------------------------- Reporter: Herman S | Owner: nobody <herman.schistad@…> | Status: new Type: Bug | Component: Documentation Milestone: | Severity: Normal Version: 1.3 | Keywords: Resolution: | Has patch: 0 Triage Stage: Accepted | Needs tests: 0 Needs documentation: 0 | Patch needs improvement: 0 | -------------------------------------+------------------------------------- Changes (by kmtracey):
* needs_better_patch: => 0 * stage: Unreviewed => Accepted * component: contrib.admin => Documentation * needs_tests: => 0 * needs_docs: => 0 Comment: The problem here involves how the "queryset" is preserved from the original action handler to the code that handles POST for the intermediate page. In the referenced blog post this is done like so: {{{ #!python if not form: form = self.AddTagForm(initial={'_selected_action': request.POST.getlist(admin.ACTION_CHECKBOX_NAME)}) }}} This code is not actually using the `queryset` parameter passed into the action function but rather the list of selected action checkboxes in the post data, which is only going to be the 100 checkboxes on the individual page. The action code should be using the passed `queryset` parameter, which does contain the full list of all items, rather than this post data. However Django's doc at the moment shows [http://docs.djangoproject.com/en/1.3/ref/contrib/admin/actions/#actions- that-provide-intermediate-pages exactly this technique] of using the POST data, and that should be fixed. As noted in the referenced blog post, the doc here is a bit lacking and in general would benefit from more complete examples. Besides not working correctly for the "select all" case, the current example of stuffing all the pks into a querystring doesn't extend well to potentially thousands of items selected -- you're going to run into querystring length issues I think. at some point. It would be good if the doc here considered some workable techniques for handling the case of thousands of selected items. -- Ticket URL: <http://code.djangoproject.com/ticket/15742#comment:1> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.