Opened 10 years ago
Last modified 9 years ago
#24947 new New feature
Move admin changelist filters into a separate class (Mixin)
Description ¶
As suggested by @mjtamlyn at DjangoConEurope, move admin changelist filters into a separate class, so that it is usable both by the admin and CBV's.
I am thinking of creating first 2, then 3 mixins:
- a BaseListFilter mixin holding most of the logic of filtering
- an AdminFilter mixin (extending BaseListFilter) with admin changelist specifics
- finally a FilteredList Mixin (extending BaseListFilter) to use with CBV's
According to the ticket's flags, the next step(s) to move this issue forward are:
- To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn't duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the "Has patch" flag on the ticket after sending a pull request and include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.
Change History (2)
comment:1 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 9 years ago
Note:
See TracTickets
for help on using tickets.
Maybe we should make this ticket a subticket of a bigger feature "Give Class Based Views (CBV) more admin functionality" or "Re-use admin code so that users can use it in CBV - like actions, filters or inlines". I think the advance of is this approach is that when we give the class based views (CBV) more functionality, 3th party projects are going to build "better" admin apps and Django can re-use the code to slowly transfer the admin to the new views.
One thing that I all ready found is that ListFilter need a ChangList to render the url for each option. So you can make a ListView that uses a one or more ListFilters in the CBV only when you want to render it you suddenly need a ChangList.
Maybe it's a better idea to start a Group Discussion for this subject.