From e4a578e70e2e48ab792e38c67579808a1def6024 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 12 Mar 2015 09:40:03 -0400 Subject: [PATCH] Fixed #24226 -- Changed admin EMPTY_CHANGELIST_VALUE from (None) to - --- django/contrib/admin/views/main.py | 4 ++-- docs/releases/1.9.txt | 3 +++ tests/admin_changelist/tests.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index c0e59f9a5f..42a2f485ca 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -20,7 +20,7 @@ from django.db import models from django.utils import six from django.utils.encoding import force_text from django.utils.http import urlencode -from django.utils.translation import ugettext, ugettext_lazy +from django.utils.translation import ugettext # Changelist settings ALL_VAR = 'all' @@ -34,7 +34,7 @@ IGNORED_PARAMS = ( ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR, TO_FIELD_VAR) # Text to display within change-list table cells if the value is blank. -EMPTY_CHANGELIST_VALUE = ugettext_lazy('(None)') +EMPTY_CHANGELIST_VALUE = '-' class ChangeList(object): diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index b75216fbc6..00ae10b56b 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -249,6 +249,9 @@ Miscellaneous * CSS and images in ``contrib.admin`` to support Internet Explorer 6 & 7 have been removed as these browsers have reached end-of-life. +* The text displayed for null columns in the admin changelist ``list_display`` + cells has changed from ``(None)`` (or its translated equivalent) to ``-``. + * ``django.http.responses.REASON_PHRASES`` and ``django.core.handlers.wsgi.STATUS_CODE_TEXT`` have been removed. Use Python's stdlib instead: :data:`http.client.responses` for Python 3 and diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py index 8e2ac13c2f..b9e2a5da02 100644 --- a/tests/admin_changelist/tests.py +++ b/tests/admin_changelist/tests.py @@ -95,7 +95,7 @@ class ChangeListTests(TestCase): context = Context({'cl': cl}) table_output = template.render(context) link = reverse('admin:admin_changelist_child_change', args=(new_child.id,)) - row_html = 'name(None)' % link + row_html = 'name-' % link self.assertNotEqual(table_output.find(row_html), -1, 'Failed to find expected row element: %s' % table_output)