#16257: contrib:admin dynamic list_display_links support
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
graveyboat | Status: new
Type: New | Component: contrib.admin
feature | Severity: Normal
Milestone: | Keywords: list_display
Version: 1.3 | override dynamic admin
Resolution: | Has patch: 1
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 1 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Comment (by julien):
Definitely a good idea, however the suggested approach could be made more
robust. In particular, it's a shame having to override
`get_list_display_links()` nearly every time `get_list_display()` is
overridden to avoid any missing field. I've posted a new patch which moves
the initialisation of the list display fields and links right into the
hooks, which means that by default `get_list_display_links()` will always
pick the first field returned by `get_list_display()`.
This would introduce a slight backwards incompatible change as the
initialisation would be done at runtime instead of when `ModelAdmin`
itself is initialised. I haven't had enough time to think about whether
this would be an issue that we need to care about -- so some feedback
would be welcome.
The test could also be improved to make the result of
`get_list_display_links()` vary based on the `request` and `list_display`
parameters.
--
Ticket URL: <https://code.djangoproject.com/ticket/16257#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.