[Django] #19755: Incremental filter

8 views
Skip to first unread message

Django

unread,
Feb 6, 2013, 9:13:35 AM2/6/13
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------+---------------------------
Reporter: paulox@… | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Keywords: filter, admin
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+---------------------------
Would be a good feature to have filter's value that change incrementally
when user select one of them.


I try to explain with an example:


{{{
class Person(models.Model):
name = models.CharField()
hair_color = models.CharField()
eye_color = models.CharField()

class PersonAdmin(admin.ModelAdmin):
list_filter = ["hair_color", "eye_color"]
}}}

At first I'll see all hair color and eye color values in the filter.

When I select an hair color value from the filter I'll see only person
with that hair color.

I would view in the eye color filter only distinct values of eye colors of
person that have hair color I selected from the filter.

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

Django

unread,
Feb 12, 2013, 2:10:05 AM2/12/13
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------

Reporter: paulox@… | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: filter, admin | Triage Stage: Design
Has patch: 0 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by slurms):

* needs_better_patch: => 0
* stage: Unreviewed => Design decision needed
* needs_tests: => 0
* needs_docs: => 0


Comment:

I was just about to close this as worksforme, because your description was
a bit ambiguous -- you're proposing to remove choices from the list
filters if you're already filtering on another value and the filtered set
no longer contains all the choices.

i.e. you have three people:

{{{
[{
'name': 'Bob',
'hair_color': 'brown',
'eye_color': 'blue'
}, {
'name': 'Bruce',
'hair_color': 'brown',
'eye_color': 'hazel'
}, {
'name': 'Brett',
'hair_color': 'ginger',
'eye_color': 'brown'
}]
}}}

and when you filter on brown hair, the list filter for eye color no longer
lists brown, as there are now only two people in the filtered set and they
have blue and hazel eyes.

Seems like an OK idea, though it does require backwards-incompatible
changes to django.contrib.admin. Marking as DDN.

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

Django

unread,
Feb 12, 2013, 3:51:47 AM2/12/13
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------

Reporter: paulox@… | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: filter, admin | Triage Stage: Design
Has patch: 0 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by paulox@…):

Sorry for my ambiguous description.

You're example it's ok and I hope my idea will be implemented in Django
1.6 !

--
Ticket URL: <https://code.djangoproject.com/ticket/19755#comment:2>

Django

unread,
Feb 12, 2013, 4:13:04 AM2/12/13
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------

Reporter: paulox@… | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: filter, admin | Triage Stage: Design
Has patch: 0 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by aaugustin):

I've found it useful to select several filters and check that no records
matched. I think there's some value in showing all the options even if
some of them don't have matching records.

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

Django

unread,
Feb 12, 2013, 9:52:23 AM2/12/13
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------

Reporter: paulox@… | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: filter, admin | Triage Stage: Design
Has patch: 0 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by paulox@…):

I think both cases are useful. You could choose one of two cases
specifying it in the code ?

--
Ticket URL: <https://code.djangoproject.com/ticket/19755#comment:4>

Django

unread,
Feb 12, 2013, 10:04:01 AM2/12/13
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------

Reporter: paulox@… | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: filter, admin | Triage Stage: Design
Has patch: 0 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by aaugustin):

This is a new feature, I suggest starting a discussion on the django-
developers mailing list to see if it gets some traction.

A patch would help (at least a proof of concept).

--
Ticket URL: <https://code.djangoproject.com/ticket/19755#comment:5>

Django

unread,
Feb 12, 2013, 11:49:51 AM2/12/13
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------

Reporter: paulox@… | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: filter, admin | Triage Stage: Design
Has patch: 0 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by paulox@…):

I'm sorry but I'm not a Django core developer and I'm not able to provide
a proof of concept.

I hope you can submit this new feature on the django-developers mailing
list and discuss with other django core developer.

--
Ticket URL: <https://code.djangoproject.com/ticket/19755#comment:6>

Django

unread,
Feb 12, 2013, 12:07:56 PM2/12/13
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------

Reporter: paulox@… | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: filter, admin | Triage Stage: Design
Has patch: 0 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by aaugustin):

Large parts of development of Django is done by people who aren't core
developers :)

--
Ticket URL: <https://code.djangoproject.com/ticket/19755#comment:7>

Django

unread,
Mar 22, 2013, 3:16:35 PM3/22/13
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------
Reporter: paulox@… | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: wontfix

Keywords: filter, admin | Triage Stage: Design
Has patch: 0 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by aaugustin):

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


Comment:

Since no one is sufficiently interested in the idea to write a patch, or
even send a proposal to django-developers, I'm going to close this feature
request.

--
Ticket URL: <https://code.djangoproject.com/ticket/19755#comment:8>

Django

unread,
Apr 17, 2013, 4:32:47 PM4/17/13
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------

Reporter: paulox@… | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: filter, admin | Triage Stage: Design
Has patch: 1 | decision needed

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

* status: closed => new
* cc: suligap@… (added)
* has_patch: 0 => 1
* resolution: wontfix =>


Comment:

Patch makes all default `FieldListFilter`s incremental if
`list_filter_incremental` option is `True` for particular `ModelAdmin`.

Incremental filters will contain only choices which when clicked will
result in non-empty changelist.

--
Ticket URL: <https://code.djangoproject.com/ticket/19755#comment:9>

Django

unread,
Apr 17, 2013, 5:01:37 PM4/17/13
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------
Reporter: paulox@… | Owner: suligap
Type: New feature | Status: assigned
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: filter, admin | Triage Stage: Design
Has patch: 1 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by suligap):

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


Comment:

I would be happy to finish this patch if it gets any traction.

--
Ticket URL: <https://code.djangoproject.com/ticket/19755#comment:10>

Django

unread,
Jan 9, 2019, 4:39:06 PM1/9/19
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------
Reporter: paulox@… | Owner:
| Przemysław Suliga

Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: filter, admin | Triage Stage: Design
| decision needed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Collin Anderson):

* cc: Collin Anderson (added)
* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/19755#comment:11>

Django

unread,
Sep 27, 2024, 10:47:00 AM9/27/24
to django-...@googlegroups.com
#19755: Incremental filter
-------------------------------------+-------------------------------------
Reporter: paulox@… | Owner:
| Przemysław Suliga
Type: New feature | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: filter, admin | Triage Stage: Design
| decision needed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Adam Johnson):

The queries to discover empty categories are now done in Django 5.0, when
facets are enabled:
https://docs.djangoproject.com/en/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.show_facets
.

Perhaps facets could automatically hide empty categories?
--
Ticket URL: <https://code.djangoproject.com/ticket/19755#comment:12>
Reply all
Reply to author
Forward
0 new messages