summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-04-08 20:39:59 -0400
committerTim Graham <timograham@gmail.com>2015-04-08 20:39:59 -0400
commit1273a7a0e808a43ce7a344bbf36d55b9436ecf41 (patch)
treea4d4e30eed1b16c3a4b2951713f368c040c438d8 /docs/ref
parent72f769f494822981db6df9524b92a2d86f8e69fe (diff)
Revert "Fixed #24474 -- Allowed configuring the admin's empty change list value."
This reverts commit 72f769f494822981db6df9524b92a2d86f8e69fe. There are several test failures that need to be fixed.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/admin/index.txt65
1 files changed, 1 insertions, 64 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index 17577377d3..4b11fed58a 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -205,33 +205,6 @@ subclass::
to its documentation for some caveats when time zone support is
enabled (:setting:`USE_TZ = True <USE_TZ>`).
-.. attribute:: ModelAdmin.empty_value_display
-
- .. versionadded:: 1.9
-
- This attribute overrides the default display value for record's fields that
- are empty (``None``, empty string, etc.). The default value is ``-`` (a
- dash). For example::
-
- from django.contrib import admin
-
- class AuthorAdmin(admin.ModelAdmin):
- empty_value_display = '-empty-'
-
- You can also override ``empty_value_display`` for all admin pages with
- :attr:`AdminSite.empty_value_display`, or for specific fields like this::
-
- from django.contrib import admin
-
- class AuthorAdmin(admin.ModelAdmin):
- fields = ('name', 'title', 'view_birth_date')
-
- def view_birth_date(self, obj):
- return obj.birth_date
-
- view_birth_date.short_name = 'birth_date'
- view_birth_date.empty_value_display = '???'
-
.. attribute:: ModelAdmin.exclude
This attribute, if given, should be a list of field names to exclude from
@@ -610,33 +583,6 @@ subclass::
class PersonAdmin(admin.ModelAdmin):
list_display = ('first_name', 'last_name', 'colored_name')
- * If the value of a field is ``None``, an empty string, or an iterable
- without elements, Django will display ``-`` (a dash). You can override
- this with :attr:`AdminSite.empty_value_display`::
-
- from django.contrib import admin
-
- admin.site.empty_value_display = '(None)'
-
- You can also use :attr:`AdminSite.empty_value_display`::
-
- class PersonAdmin(admin.ModelAdmin):
- empty_value_display = 'unknown'
-
- Or on a field level::
-
- class PersonAdmin(admin.ModelAdmin):
- list_display = ('name', 'birth_date_view')
-
- def birth_date_view(self, obj):
- return obj.birth_date
-
- birth_date_view.empty_value_display = 'unknown'
-
- .. versionadded:: 1.9
-
- The ability to customize ``empty_value_display`` was added.
-
* If the string given is a method of the model, ``ModelAdmin`` or a
callable that returns True or False Django will display a pretty
"on" or "off" icon if you give the method a ``boolean`` attribute
@@ -658,6 +604,7 @@ subclass::
class PersonAdmin(admin.ModelAdmin):
list_display = ('name', 'born_in_fifties')
+
* The ``__str__()`` (``__unicode__()`` on Python 2) method is just
as valid in ``list_display`` as any other model method, so it's
perfectly OK to do this::
@@ -2521,16 +2468,6 @@ Templates can override or extend base admin templates as described in
Path to a custom template that will be used by the admin site app index view.
-.. attribute:: AdminSite.empty_value_display
-
- .. versionadded:: 1.9
-
- The string to use for displaying empty values in the admin site's change
- list. Defaults to a dash. The value can also be overridden on a per
- ``ModelAdmin`` basis and on a custom field within a ``ModelAdmin`` by
- setting an ``empty_value_display`` attribute on the field. See
- :attr:`ModelAdmin.empty_value_display` for examples.
-
.. attribute:: AdminSite.login_template
Path to a custom template that will be used by the admin site login view.