[Django] #34718: Allow django.contrib.admin's ListFilter to render details tag collasped by default

10 views
Skip to first unread message

Django

unread,
Jul 17, 2023, 9:10:56 AM7/17/23
to django-...@googlegroups.com
#34718: Allow django.contrib.admin's ListFilter to render details tag collasped by
default
--------------------------------------------+------------------------
Reporter: Christophe Henry | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 4.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------------+------------------------
Custom ``ListFilter`` in django admin can yield a lot of results, in which
case, the page can be very long.

This could be solved by adding a ``details_collapsed = True`` attribute to
the ``ListFilter`` class and render the ``<details>`` tag according to
that attribute.

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

Django

unread,
Jul 17, 2023, 9:11:56 AM7/17/23
to django-...@googlegroups.com
#34718: Allow django.contrib.admin's ListFilter to render details tag collasped by
default
----------------------------------+--------------------------------------

Reporter: Christophe Henry | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
----------------------------------+--------------------------------------
Changes (by Christophe Henry):

* ui_ux: 0 => 1
* component: Uncategorized => contrib.admin


Old description:

> Custom ``ListFilter`` in django admin can yield a lot of results, in
> which case, the page can be very long.
>
> This could be solved by adding a ``details_collapsed = True`` attribute
> to the ``ListFilter`` class and render the ``<details>`` tag according to
> that attribute.

New description:

Custom `ListFilter` in django admin can yield a lot of results, in which
case, the page can be very long.

This could be solved by adding a `details_collapsed = True` attribute to
the `ListFilter` class and render the `<details>` tag according to that
attribute.

--

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

Django

unread,
Jul 17, 2023, 12:03:09 PM7/17/23
to django-...@googlegroups.com
#34718: Allow django.contrib.admin's ListFilter to render details tag collasped by
default
-------------------------------------+-------------------------------------

Reporter: Christophe Henry | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Marcelo Galigniana (added)
* type: Uncategorized => Cleanup/optimization


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

Django

unread,
Jul 17, 2023, 12:25:47 PM7/17/23
to django-...@googlegroups.com
#34718: Allow django.contrib.admin's ListFilter to render details tag collasped by
default
-------------------------------------+-------------------------------------
Reporter: Christophe Henry | Owner:
Type: | Christophe Henry
Cleanup/optimization | Status: assigned

Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Marcelo Galigniana):

* owner: nobody => Christophe Henry
* status: new => assigned


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

Django

unread,
Jul 17, 2023, 1:27:15 PM7/17/23
to django-...@googlegroups.com
#34718: Allow django.contrib.admin's ListFilter to render details tag collasped by
default
-------------------------------------+-------------------------------------
Reporter: Christophe Henry | Owner:
Type: | Christophe Henry
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

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


Comment:

I don't think that removing `open` will make much of a difference as
exactly the same HTML will be build (with all options).

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

Django

unread,
Jul 17, 2023, 2:36:17 PM7/17/23
to django-...@googlegroups.com
#34718: Allow django.contrib.admin's ListFilter to render details tag collasped by
default
-------------------------------------+-------------------------------------
Reporter: Christophe Henry | Owner:
Type: | Christophe Henry
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Marcelo Galigniana):

Here is the PR where we added the collapse filter arrows (to solve the
''long page'' problem): https://github.com/django/django/pull/15424

I wouldn't allow user edit ListFilter as, ''if I'm not wrong'', we don't
recommend it in
https://docs.djangoproject.com/en/4.2/ref/contrib/admin/filters

And add an option in SimpleListFilter to collapse ALL filters by default
would make sense?

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

Django

unread,
Jul 17, 2023, 2:46:20 PM7/17/23
to django-...@googlegroups.com
#34718: Allow django.contrib.admin's ListFilter to render details tag collasped by
default
-------------------------------------+-------------------------------------
Reporter: Christophe Henry | Owner:
Type: | Christophe Henry
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:5 Marcelo Galigniana]:


> And add an option in SimpleListFilter to collapse ALL filters by default
would make sense?

My point is that if you have `ListFilter` with a long list of options, you
will probably use something other than the built-in `ListFilter` because
collapsing options by default would not solve the long-rendering issue.

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

Django

unread,
Jul 17, 2023, 3:02:50 PM7/17/23
to django-...@googlegroups.com
#34718: Allow django.contrib.admin's ListFilter to render details tag collasped by
default
-------------------------------------+-------------------------------------
Reporter: Christophe Henry | Owner:
Type: | Christophe Henry
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Marcelo Galigniana):

Yes! I agree with you +1

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

Reply all
Reply to author
Forward
0 new messages