#36114: when an object's __str__ consists only of whitespace, the link does not
appear in admin list page.
-------------------------------------+-------------------------------------
Reporter: Antoliny | Owner: Antoliny
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.1
Severity: Normal | Resolution:
Keywords: list_display_links, | Triage Stage:
list_display | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Antoliny):
Replying to [comment:3 Tim Graham]:
> What's the use case for str being a blank value and what is your
proposal to fix it?
I think that a `__str__` value being composed entirely of blank spaces is
extremely rare unless it's a user mistake. However, for fields, when they
consist only of blank spaces, they are treated as `None` and return the
default empty_value("-"). Similarly, when `__str__` is composed of only
blank spaces, it should return a default empty_value like "-" so that it
can function as a link when set in `list_display_links`.
It seems that adding a bit of logic to the
`item_for_result`(contrib.admin.templatetags.admin_list.py) function would
suffice.
--
Ticket URL: <https://code.djangoproject.com/ticket/36114#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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019480c6c47f-7794b813-7097-4df8-bdd5-dd8182305b6d-000000%40eu-central-1.amazonses.com.