[Django] #24947: Move admin changelist filters into a separate class (Mixin)

22 views
Skip to first unread message

Django

unread,
Jun 7, 2015, 4:14:48 AM6/7/15
to django-...@googlegroups.com
#24947: Move admin changelist filters into a separate class (Mixin)
-------------------------------+-------------------------------------
Reporter: nanuxbe | Owner: nanuxbe
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Keywords: admin changelist filter
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-------------------------------------
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

--
Ticket URL: <https://code.djangoproject.com/ticket/24947>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 9, 2015, 6:19:33 PM6/9/15
to django-...@googlegroups.com
#24947: Move admin changelist filters into a separate class (Mixin)
-------------------------------------+-------------------------------------

Reporter: nanuxbe | Owner: nanuxbe
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin changelist | Triage Stage: Accepted
filter |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24947#comment:1>

Django

unread,
Nov 7, 2015, 9:22:49 AM11/7/15
to django-...@googlegroups.com
#24947: Move admin changelist filters into a separate class (Mixin)
-------------------------------------+-------------------------------------

Reporter: nanuxbe | Owner: nanuxbe
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin changelist | Triage Stage: Accepted
filter |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Feb 14, 2025, 6:40:55 AM2/14/25
to django-...@googlegroups.com
#24947: Move admin changelist filters into a separate class (Mixin)
-------------------------------------+-------------------------------------
Reporter: Emmanuelle | Owner: Antoliny
Delescolle |
Type: New feature | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin changelist | Triage Stage: Accepted
filter |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Antoliny):

* cc: Antoliny (added)
* owner: Emmanuelle Delescolle => Antoliny
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/24947#comment:3>

Django

unread,
Feb 14, 2025, 9:00:34 AM2/14/25
to django-...@googlegroups.com
#24947: Move admin changelist filters into a separate class (Mixin)
-------------------------------------+-------------------------------------
Reporter: Emmanuelle | Owner: Antoliny
Delescolle |
Type: New feature | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin changelist | Triage Stage: Accepted
filter |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Emma Delescolle):

*hides under a rock*

I had absolutely no recollection this ticket had ever been accepted. I'm
very glad it was. And now that you have taken it under your wing, I have
no intention of stealing your thunder. But if you need help or a review or
anything, feel free to ping me here or on github!
--
Ticket URL: <https://code.djangoproject.com/ticket/24947#comment:4>

Django

unread,
Feb 14, 2025, 9:13:11 AM2/14/25
to django-...@googlegroups.com
#24947: Move admin changelist filters into a separate class (Mixin)
-------------------------------------+-------------------------------------
Reporter: Emmanuelle | Owner: Antoliny
Delescolle |
Type: New feature | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin changelist | Triage Stage: Accepted
filter |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Antoliny):

Replying to [comment:4 Emma Delescolle]:
> *hides under a rock*
>
> I had absolutely no recollection this ticket had ever been accepted. I'm
very glad it was. And now that you have taken it under your wing, I have
no intention of stealing your thunder. But if you need help or a review or
anything, feel free to ping me here or on github!

Hello Emma Delescolle :)
I am currently working on a similar issue
[https://code.djangoproject.com/ticket/36175 (Issue 36175)].
While working on this, I felt that not only `Pagination` but also `Filter`
should be separated. While searching to see if a similar issue existed, I
came across this ticket.

I agree that the `ChangeList` class has too many responsibilities, and I
believe a structural improvement is necessary. However, I think this issue
can only proceed successfully after completing the refactoring of
`Pagination`.
(It will probably depend on my skills..)

Thank you for submitting this ticket Emma Delescolle!
I will do my best to improve the Admin page. Since separating `Pagination`
is a similar task, having your review would be incredibly helpful and
greatly appreciated 💪
--
Ticket URL: <https://code.djangoproject.com/ticket/24947#comment:5>

Django

unread,
Feb 17, 2025, 5:12:37 AM2/17/25
to django-...@googlegroups.com
#24947: Move admin changelist filters into a separate class (Mixin)
-------------------------------------+-------------------------------------
Reporter: Emmanuelle | Owner: Antoliny
Delescolle |
Type: New feature | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin changelist | Triage Stage: Accepted
filter |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Emma Delescolle):

I'll give it a look some time tomorrow!
--
Ticket URL: <https://code.djangoproject.com/ticket/24947#comment:6>
Reply all
Reply to author
Forward
0 new messages