Re: [Django] #8851: Please add a default option to list_filter in the admin interface

65 views
Skip to first unread message

Django

unread,
May 13, 2011, 8:35:03 AM5/13/11
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: nobody
<riskable@…> | Status: reopened
Type: New | Component: contrib.admin
feature | Severity: Normal
Milestone: | Keywords: admin, list_filter,
Version: SVN | default
Resolution: | Has patch: 0
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
-------------------------------------+-------------------------------------
Changes (by mofle):

* easy: => 0


Comment:

This would be very useful. Hoping for this in 1.4.

There is a ugly workaround on [http://stackoverflow.com/questions/851636
/default-filter-in-django-admin/3783930#3783930 StackOverflow], but this
does not show the default filter in the filterbar.

--
Ticket URL: <http://code.djangoproject.com/ticket/8851#comment:14>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 9, 2012, 11:08:15 PM9/9/12
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: nobody
<riskable@…> | Status: reopened
Type: New feature | Version: master
Component: contrib.admin | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: admin, list_filter, | Needs documentation: 0
default | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by net147):

* cc: net147 (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:16>

Django

unread,
Nov 30, 2012, 2:36:11 AM11/30/12
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: nobody
<riskable@…> | Status: reopened
Type: New feature | Version: master
Component: contrib.admin | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: admin, list_filter, | Needs documentation: 0
default | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by charettes):

I think you can achieve this in 1.4+ by subclassing
`django.contrib.admin.ChoicesFieldListFilter`.

--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:17>

Django

unread,
Jun 3, 2013, 11:12:45 AM6/3/13
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: nobody
<riskable@…> | Status: closed

Type: New feature | Version: master
Component: contrib.admin | Resolution: fixed

Severity: Normal | Triage Stage: Accepted
Keywords: admin, list_filter, | Needs documentation: 0
default | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by oinopion):

* status: new => closed
* resolution: => fixed


Comment:

This feature has been already introduced in Django, unfortunately, I don't
know when. Basically, subclass `SimpleListFilter` and override two methods
`lookups` and `queryset`. You can read about it in
[https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter
ModelAdmin.list_filter docs]

I'm closing this ticket as fixed, as described feature is in my opinion
what you were looking for. If you feel it's not what you need, please
reopen with detailed description what should be changed.

--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:19>

Django

unread,
Feb 5, 2014, 3:51:38 PM2/5/14
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: nobody
<riskable@…> | Status: new

Type: New feature | Version: master
Component: contrib.admin | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: admin, list_filter, | Needs documentation: 0
default | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by schrinaw@…):

* status: closed => new
* resolution: fixed =>


Comment:

I would argue that this is not fixed. I believe I have the same issue as
the OP - I want to choose which of the available filter options should be
selected by default. I don't want to customize the filtering behavior by
subclassing SimpleListFilter. The desired behavior is that when I go to
admin changelist url, it is *as if I had already chosen one of the
filtering options*. I don't want to change the behavior of the filtering
options. I just want one (the defined default) to be pre-selected.

--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:20>

Django

unread,
Aug 20, 2014, 5:27:53 PM8/20/14
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: nobody
<riskable@…> | Status: new
Type: New feature | Version: master
Component: contrib.admin | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: admin, list_filter, | Needs documentation: 0
default | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by trbs):

* cc: trbs@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:21>

Django

unread,
Sep 10, 2015, 10:36:45 AM9/10/15
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: ckirby
<riskable@…> |
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by ckirby):

* status: new => assigned
* owner: nobody => ckirby


--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:22>

Django

unread,
Sep 10, 2015, 10:51:03 AM9/10/15
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner:
<riskable@…> |
Type: New feature | Status: new

Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by ckirby):

* owner: ckirby =>
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:23>

Django

unread,
Nov 7, 2015, 6:16:47 AM11/7/15
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: hvdklauw
<riskable@…> |
Type: New feature | Status: assigned

Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by hvdklauw):

* status: new => assigned

* owner: => hvdklauw


Comment:

Working on this during duth sprints

--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:24>

Django

unread,
Nov 7, 2015, 8:26:59 AM11/7/15
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: hvdklauw
<riskable@…> |
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by hvdklauw):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:25>

Django

unread,
Nov 8, 2015, 6:10:14 PM11/8/15
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: hvdklauw
<riskable@…> |
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by avorio):

* cc: a@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:26>

Django

unread,
Nov 8, 2015, 6:11:04 PM11/8/15
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: hvdklauw
<riskable@…> |
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by avorio):

I'm willing to test this out once a patch has been committed.

Implemented simply, as originally described, this would be a very useful
feature indeed.

--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:27>

Django

unread,
Nov 9, 2015, 2:55:46 PM11/9/15
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: hvdklauw
<riskable@…> |
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

While testing after commit is certainly helpful, if you can give feedback
on and/or test the [https://github.com/django/django/pull/5579 pull
request] before it's committed, that's even more helpful.

--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:28>

Django

unread,
Nov 13, 2015, 4:52:36 AM11/13/15
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: hvdklauw
<riskable@…> |
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


Comment:

Just did some testing as well, and the filters selected value does not
work correctly with the defaults. Working on a fix.

--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:29>

Django

unread,
Nov 20, 2015, 12:04:24 PM11/20/15
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: hvdklauw
<riskable@…> |
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_better_patch: 1 => 0


Comment:

Totally forgot to update the ticket, it's all done and ready now.

--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:30>

Django

unread,
Dec 14, 2015, 7:53:42 AM12/14/15
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: hvdklauw
<riskable@…> |
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by giuliettamasina):

* cc: markus.magnuson@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:31>

Django

unread,
Jan 9, 2016, 4:19:30 AM1/9/16
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: hvdklauw
<riskable@…> |
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by xblitz):

+1 and bump, will this be included in 1.10 ?

--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:32>

Django

unread,
Jan 9, 2016, 2:00:35 PM1/9/16
to django-...@googlegroups.com
#8851: Please add a default option to list_filter in the admin interface
-------------------------------------+-------------------------------------
Reporter: Riskable | Owner: hvdklauw
<riskable@…> |
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, list_filter, | Triage Stage: Accepted
default |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

You can help by reviewing the patch using the PatchReviewChecklist and
marking the ticket "ready for checkin" when all looks good.

--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:33>

Reply all
Reply to author
Forward
0 new messages