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.
* 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>
* cc: Marcelo Galigniana (added)
* type: Uncategorized => Cleanup/optimization
--
Ticket URL: <https://code.djangoproject.com/ticket/34718#comment:2>
* owner: nobody => Christophe Henry
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/34718#comment:3>
* 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>
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>
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>
Comment (by Marcelo Galigniana):
Yes! I agree with you +1
--
Ticket URL: <https://code.djangoproject.com/ticket/34718#comment:7>