5 | | It seems that adding a bit of logic to the `item_for_result`(contrib.admin.templatetags.admin_list.py) function would suffice. |
| 5 | It seems that adding a bit of logic to the `item_for_result` function would suffice. |
| 6 | {{{#!diff |
| 7 | diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py |
| 8 | index 7a49587172..76dfda9d9e 100644 |
| 9 | --- a/django/contrib/admin/templatetags/admin_list.py |
| 10 | +++ b/django/contrib/admin/templatetags/admin_list.py |
| 11 | @@ -226,6 +226,8 @@ def items_for_result(cl, result, form): |
| 12 | if f is None or f.auto_created: |
| 13 | if field_name == "action_checkbox": |
| 14 | row_classes = ["action-checkbox"] |
| 15 | + elif field_name == "__str__": |
| 16 | + value = value.strip() |
| 17 | boolean = getattr(attr, "boolean", False) |
| 18 | # Set boolean for attr that is a property, if defined. |
| 19 | if isinstance(attr, property) and hasattr(attr, "fget"): |
| 20 | |
| 21 | }}} |