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
--
Ticket URL: <https://code.djangoproject.com/ticket/24947>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/24947#comment:1>
Comment (by Merino):
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/24947#comment:2>