Opened 5 years ago
Last modified 5 years ago
#30951 closed Cleanup/optimization
Admin Documentation recommends an incorrect method to get selected objects. — at Initial Version
Reported by: | Daniel | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 2.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
( https://docs.djangoproject.com/en/2.2/ref/contrib/admin/actions/#actions-that-provide-intermediate-pages )
/docs/ref/contrib/admin/actions.txt
in paragraph
Actions that provide intermediate pages
recommends directly accessing the form values:
selected = request.POST.getlist(admin.ACTION_CHECKBOX_NAME)
to get a list of selected ids. This fails to take into account if the select all
box has been selected.
Note:
See TracTickets
for help on using tickets.