#6903: Go back to old change_list view after hitting save -------------------------------+------------------------------------ Reporter: jarrow | Owner: oinopion Type: New feature | Status: assigned Component: contrib.admin | Version: master Severity: Normal | Resolution: Keywords: admin | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 1 -------------------------------+------------------------------------
Comment (by loic84): I've tried to sum up the different options that have been used so far in this ticket. '''The problem:''' We need the sticky filters to survive an arbitrarily long path made of GET, POST, and Redirects. '''The options:''' The only 2 *consistent* ways of doing it are the querystring and the session. There is a third option that involve reading the referrer and storing information in a hidden field, but at least for redirects and html links we need a fallback method. There is no perfect solution: - If we pick the querystring, we add a lot of things to the URLs. - If we pick the session, we lose the direct link between the `change_list` that started the chain of events and the one to which we return. (as explained in comment:71) - If we pick an hybrid solution, we lack consistency and we still suffer from the defects of whatever we use as a fallback. For the issue at hand I value predictably and reliability much more than the aesthetic of the URL, especially for an admin site. So I'd like to suggest using the querystring and offering an option to switch off the behavior: `ModelAdmin.sticky_filters`. The developer gets to pick, he can have prestine URLs or a robust preservation of changelist filters, not both. If we go with that, we'll have to decide what's the default value of the `sticky_filters` flag. Proof of concept: https://github.com/loic/django/compare/ticket6903 I tested it manually and I have yet to fail it, I'll write the docs and tests tomorrow. Unlike previous attempts at using the querystring, it relies on a templatetag that accounts for existing querystring parameters. I've also left out the breadcrumbs, as I like that they point to a fresh `change_list`, but that's debatable, I can easily add them. Thoughts? -- Ticket URL: <https://code.djangoproject.com/ticket/6903#comment:86> Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.0844b3e98a9863fe14b615e26e2410ad%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.