summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRyanwalker277 <andianurag277@gmail.com>2023-09-14 17:40:20 +0530
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-09-16 20:54:26 +0200
commit225328efd9814f2e922ee77fb48a3eea7428c397 (patch)
treefaa3793b275ea6a3e83120ae3648d790c3c856f7 /docs
parent2f1ab16be54255213d5c3e4d925a3a24997dc917 (diff)
Fixed #31558 -- Added support for boolean attribute on properties in ModelAdmin.list_display.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/admin/index.txt6
-rw-r--r--docs/releases/5.0.txt3
2 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index aa30c413fa..79345ea3d1 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -796,6 +796,7 @@ subclass::
@admin.display(
ordering="last_name",
description="Full name of the person",
+ boolean=False,
)
def full_name(self):
return self.first_name + " " + self.last_name
@@ -816,9 +817,14 @@ subclass::
my_property.short_description = "Full name of the person"
my_property.admin_order_field = "last_name"
+ my_property.boolean = False
full_name = property(my_property)
+ .. versionchanged:: 5.0
+
+ Support for ``boolean`` attribute on properties was added.
+
* The field names in ``list_display`` will also appear as CSS classes in
the HTML output, in the form of ``column-<field_name>`` on each ``<th>``
element. This can be used to set column widths in a CSS file for example.
diff --git a/docs/releases/5.0.txt b/docs/releases/5.0.txt
index 1c17cbfcf5..ac0dda9feb 100644
--- a/docs/releases/5.0.txt
+++ b/docs/releases/5.0.txt
@@ -211,6 +211,9 @@ Minor features
* The new :meth:`.AdminSite.get_model_admin` method returns an admin class for
the given model class.
+* Properties in :attr:`.ModelAdmin.list_display` now support ``boolean``
+ attribute.
+
:mod:`django.contrib.admindocs`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~