Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#32876 closed Uncategorized (invalid)

The parametered `all` is not preserved after save object in django admin. — at Version 2

Reported by: A-hông Owned by: nobody
Component: contrib.admin Version: 3.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by A-hông)

  1. Login in django admin
  2. Enter a changelist page of model
  3. Order by a column in changelist page
  4. Display all in changelist page
  5. Enter change form page
  6. Save
  7. The order is kept but all is disappeared

Change History (2)

comment:1 by Mariusz Felisiak, 3 years ago

Component: Uncategorizedcontrib.admin
Resolution: invalid
Status: newclosed

Thanks for the report, however I don't see any issue here. all in the changelist filters are achieved by removing previous filters from the query string so there is nothing to preserve, in the 7th step a changelist will display all records as expected. If you're having trouble understanding how Django works, see TicketClosingReasons/UseSupportChannels for ways to get help.

comment:2 by A-hông, 3 years ago

Description: modified (diff)

q(query), o(order) and all(display all) can be set at the same time.
q(query) and o(order) are kept but all(display all) not, when from change form back to changelist.

all should be kept in the fillter of changelist.
I found parse_qsl in admin_urls.py will remove the keys which has no value.

from urllib.parse import parse_qsl, unquote, urlparse, urlunparse
parse_qsl('q=2&all=')
=> [('q', '2')]

It is why all(display all) cannot be kept.

Note: See TracTickets for help on using tickets.
Back to Top