#35765: Change label of list_display with __ lookup to only show the bit after 
the
__
--------------------------------+--------------------------------------
     Reporter:  Kevin Renskers  |                    Owner:  (none)
         Type:  Uncategorized   |                   Status:  closed
    Component:  contrib.admin   |                  Version:  5.0
     Severity:  Normal          |               Resolution:  wontfix
     Keywords:                  |             Triage Stage:  Unreviewed
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+--------------------------------------
Changes (by Sarah Boyce):

 * cc: Natalia Bidart, Tom Carrick (added)
 * resolution:   => wontfix
 * status:  new => closed

Comment:

 Here is a tweak to a current test to show the headers:
 {{{#!diff
 --- a/tests/admin_changelist/tests.py
 +++ b/tests/admin_changelist/tests.py
 @@ -1705,6 +1705,9 @@ class ChangeListTests(TestCase):
          response = m.changelist_view(request)
          self.assertContains(response, parent.name)
          self.assertContains(response, child.name)
 +        self.assertContains(response, '<a href="?o=1">Name</a>')
 +        self.assertContains(response, '<a href="?o=2">Parent  name</a>')
 +        self.assertContains(response, '<a href="?o=3">Parent  parent
 name</a>')

      def test_list_display_related_field_null(self):
 }}}

 Adding the relationship reduces the chance of duplicate header names. This
 proposal would mean the above example would have three headers called
 `Name`
 I would maybe have a preference of having the labels like `Name (Parent)`
 and `Name (Parent - Parent)` and so from your example `PACE ACCOUNT ID
 (ACCOUNT SETTINGS)`

 I have cc-ed some folks involved in the feature and it might be worth
 moving the discussion to the
 [https://forum.djangoproject.com/c/internals/5 Django Forum].
 It's not a clear to me that we should drop the relationship by default,
 just because it is long. So for now I will "wontfix" the ticket but it can
 be reopened after a discussion
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35765#comment:1>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070191f9c8e745-9776c8d3-bea1-4b6e-a863-95470ff3ad68-000000%40eu-central-1.amazonses.com.

Reply via email to