Code

Opened 8 years ago

Closed 5 years ago

#2382 closed enhancement (duplicate)

[patch] Save Filtering List Views in Admin into Session

Reported by: anonymous Owned by: nobody
Component: contrib.admin Version:
Severity: minor Keywords: nfa-changelist
Cc: sixthgear Triage Stage: Someday/Maybe
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

Another minor, but useful addition - when someone filters a list of objects in the admin, then edits one, then goes back to that list of objects, it would be nice if this filtering would be saved in the session so that it can span across pages. Many times people still want to see the same filtering on the object list page.

Attachments (1)

2382.patch (3.5 KB) - added by arnaud AT pimentech DOT net 8 years ago.
Propagates filter values (in GET) when editing or adding an object in admin

Download all attachments as: .zip

Change History (13)

Changed 8 years ago by arnaud AT pimentech DOT net

Propagates filter values (in GET) when editing or adding an object in admin

comment:1 Changed 8 years ago by arnaud AT pimentech DOT net

  • Summary changed from Save Filtering List Views in Admin into Session to [patch] Save Filtering List Views in Admin into Session

I just added a patch to propagate filters as GET values when editing or adding an object in admin.

I don't think a hybrid version using both session and GET values is really practical. Maybe we should change the filter system to be session-only, but I'm not sure this is such a good idea. This would allow us to store filters on a per-model basis, though.

comment:2 Changed 7 years ago by SmileyChris

  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 6 years ago by jacob

  • Triage Stage changed from Design decision needed to Someday/Maybe

At some point, we'll be reworking the admin interface, and this will be one of the things we examine at that time.

comment:4 Changed 6 years ago by jakub_vysoky

  • Keywords nfa-changelist added

comment:5 Changed 6 years ago by mrts

  • milestone set to post-1.0

Probably not in scope for 1.0.

comment:6 Changed 5 years ago by kmtracey

#9467 is another request for this ability.

comment:7 follow-up: Changed 5 years ago by jacmkno

Some thoughts:
Session based filters is not an option. The option of sharing the URL to a filtered listing is a great functionality that cannot be lost.
In addition to preserving the filters after editing or adding, the fields in the add form should be pre-filled according to the filters applied.
(But that could be a separate ticket).

comment:8 in reply to: ↑ 7 Changed 5 years ago by jacmkno

Maybe the filters can be saved into the session but they have to come back into the URL after editing or adding. This sounds as a good solution.

In the session the admin could have a dictionary with applied filters for each model. When the users go to the model record listing page, the admin detects 2 things:

  1. The comming request does not apply any filters
  2. There are some filters applied to the requested model in the session

In that case the admin can make a redirection to the same listing but putting all the session filters inside the URL as they normally are.
There should also be an extra control paramenter like: no_session_filters=1, and if that parameter comes in the request the admin does not make the redirection.

This sounds like a clean solution to me.

comment:9 Changed 5 years ago by sixthgear

  • Cc sixthgear added

comment:10 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:11 Changed 5 years ago by alTus

  • Patch needs improvement set

This patch isn't up-to-date.
Could someone provide a new one or at least give some recomendations how to get such functionality?

comment:12 Changed 5 years ago by ramiro

  • Resolution set to duplicate
  • Status changed from new to closed

Wait, this is a duplicate of #6903 that has an up-to-date patch. The current implementation there stored uses URL query strings to persist the filter status instead of sessions but the discussion in the ticket and in the associated mailing thread proposes also using session.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.