[Django] #28991: Add new BlankFieldListFilter admin filter

46 views
Skip to first unread message

Django

unread,
Jan 5, 2018, 5:53:41 PM1/5/18
to django-...@googlegroups.com
#28991: Add new BlankFieldListFilter admin filter
-----------------------------------------+------------------------
Reporter: Jonas Haag | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
Add a new admin filter that allows to show only objects with a blank (or
non-blank) field value. Shows three options "all", "blank", "not blank".

This is something I've regularly required and there doesn't seem to be any
third party package implementing this, but there are at least a few other
people having the need: https://stackoverflow.com/questions/37799694
/django-admin-list-filter-filter-field-by-is-empty-none-or-empty-string
https://gist.github.com/haplo/2695675 Note that while the filter could
easily live in a third party package, I think it makes sense to include it
in Django. It's not much code and I guess it's a common requirement.

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

Django

unread,
Jan 5, 2018, 5:54:24 PM1/5/18
to django-...@googlegroups.com
#28991: Add new BlankFieldListFilter admin filter
-------------------------------+--------------------------------------

Reporter: Jonas Haag | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Jonas Haag):

PR https://github.com/django/django/pull/9546

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

Django

unread,
Jan 5, 2018, 7:33:13 PM1/5/18
to django-...@googlegroups.com
#28991: Add new BlankFieldListFilter admin filter
-------------------------------+--------------------------------------

Reporter: Jonas Haag | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Tim Graham):

Duplicate of #28687?

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

Django

unread,
Jan 5, 2018, 7:39:42 PM1/5/18
to django-...@googlegroups.com
#28991: Add new BlankFieldListFilter admin filter
-------------------------------+--------------------------------------

Reporter: Jonas Haag | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Jonas Haag):

Not exactly here we're looking at

- a new filter for
- blank values
- of any kind of field (not necessarily relation fields)

#28687 is looking at

- an extension of an existing filter
- of null values
- that deals with relation fields

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

Django

unread,
Jan 10, 2018, 2:14:08 PM1/10/18
to django-...@googlegroups.com
#28991: Add an admin filter with choices "all", "blank", "not blank"
-------------------------------+------------------------------------

Reporter: Jonas Haag | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

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

* needs_docs: 0 => 1
* stage: Unreviewed => Accepted


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

Django

unread,
Nov 2, 2018, 7:32:21 PM11/2/18
to django-...@googlegroups.com
#28991: Add an admin filter with choices "all", "blank", "not blank"
-------------------------------+------------------------------------

Reporter: Jonas Haag | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Christophe Baldy):

Hi,

I tried to rework and improve and the original PR with my own PR
[https://github.com/django/django/pull/10599]

(This my first attempt to contribute to Django)

Thanks

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

Django

unread,
Nov 5, 2018, 5:48:35 AM11/5/18
to django-...@googlegroups.com
#28991: Add an admin filter with choices "all", "blank", "not blank"
-------------------------------+---------------------------------------
Reporter: Jonas Haag | Owner: Basil Dubyk
Type: New feature | Status: assigned
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

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

* owner: nobody => Basil Dubyk
* status: new => assigned


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

Django

unread,
Nov 5, 2018, 5:50:08 AM11/5/18
to django-...@googlegroups.com
#28991: Add an admin filter with choices "all", "blank", "not blank"
-------------------------------+------------------------------------
Reporter: Jonas Haag | Owner: (none)

Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

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

* owner: Basil Dubyk => (none)
* status: assigned => new


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

Django

unread,
Nov 23, 2018, 7:14:34 PM11/23/18
to django-...@googlegroups.com
#28991: Add an admin filter with choices "all", "blank", "not blank"
-------------------------------+------------------------------------
Reporter: Jonas Haag | Owner: (none)
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_docs: 1 => 0
* needs_better_patch: 0 => 1


Comment:

Left a few comments for improvements on the PR.

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

Django

unread,
Dec 28, 2018, 5:27:41 PM12/28/18
to django-...@googlegroups.com
#28991: Add an admin filter with choices "all", "blank", "not blank"
-------------------------------+------------------------------------
Reporter: Jonas Haag | Owner: (none)
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Christophe Baldy):

* needs_better_patch: 1 => 0


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

Django

unread,
Feb 18, 2019, 10:53:57 AM2/18/19
to django-...@googlegroups.com
#28991: Add an admin filter with choices "all", "blank", "not blank"
-------------------------------+------------------------------------
Reporter: Jonas Haag | Owner: (none)
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


Comment:

Commented on PR: Docs need some clarification. Possibly some extra tests
needed. (?) Needs updating to target v3.0.

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

Django

unread,
Dec 21, 2019, 12:14:17 PM12/21/19
to django-...@googlegroups.com
#28991: Add an admin filter with choices "all", "blank", "not blank"
-------------------------------------+-------------------------------------
Reporter: Jonas Haag | Owner: Federico
| Jaramillo Martínez

Type: New feature | Status: assigned
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Federico Jaramillo Martínez):

* owner: (none) => Federico Jaramillo Martínez


* status: new => assigned


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

Django

unread,
Dec 21, 2019, 12:28:07 PM12/21/19
to django-...@googlegroups.com
#28991: Add an admin filter with choices "all", "blank", "not blank"
-------------------------------------+-------------------------------------
Reporter: Jonas Haag | Owner: Federico
| Jaramillo Martínez
Type: New feature | Status: assigned
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Federico Jaramillo Martínez):

* needs_better_patch: 1 => 0


Comment:

PR https://github.com/django/django/pull/12239

--
Ticket URL: <https://code.djangoproject.com/ticket/28991#comment:12>

Django

unread,
Jan 2, 2020, 8:06:06 AM1/2/20
to django-...@googlegroups.com
#28991: Add an admin filter with choices "all", "blank", "not blank"
-------------------------------------+-------------------------------------
Reporter: Jonas Haag | Owner: Federico
| Jaramillo Martínez
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

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

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/28991#comment:13>

Django

unread,
Jan 3, 2020, 3:33:03 AM1/3/20
to django-...@googlegroups.com
#28991: Add an admin filter with choices "all", "blank", "not blank"
-------------------------------------+-------------------------------------
Reporter: Jonas Haag | Owner: Federico
| Jaramillo Martínez
Type: New feature | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"372eaa395f167c038e546c6be554c96014d40109" 372eaa39]:
{{{
#!CommitTicketReference repository=""
revision="372eaa395f167c038e546c6be554c96014d40109"
Fixed #28991 -- Added EmptyFieldListFilter class in admin.filters.

Thanks Simon Charette and Carlton Gibson for reviews.

Co-Authored-By: Jonas Haag <jo...@lophus.org>
Co-Authored-By: Christophe Baldy <christop...@polyconseil.fr>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28991#comment:14>

Reply all
Reply to author
Forward
0 new messages