diff options
| author | Tim Graham <timograham@gmail.com> | 2013-02-23 09:45:34 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-02-23 09:45:34 -0500 |
| commit | 722683f508566cf06bcc85f9f1810c3cde80344c (patch) | |
| tree | 745f2843043ddb4fc492bcbd783cac017fa1e5dd /docs | |
| parent | 1b7fb29dfb8579dc627208b8ca6500b5341489a9 (diff) | |
Fixed #19887 - Noted when callables may be used in ModelAdmin.fields and ModelAdmin.fieldset.
Thanks Patrick Strasser for the suggestion and Zbigniew Siciarz for the patch.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index c93c974a49..353c121cbc 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -186,6 +186,11 @@ subclass:: values defined in :attr:`ModelAdmin.readonly_fields` to be displayed as read-only. + The ``fields`` option, unlike :attr:`~ModelAdmin.list_display`, may contain + only field names of the model or the form specified by + :attr:`~ModelAdmin.form`, not callables. However it *can* contain callables + if they are defined in :attr:`~ModelAdmin.readonly_fields`. + To display multiple fields on the same line, wrap those fields in their own tuple. In this example, the ``url`` and ``title`` fields will display on the same line and the ``content`` field will be displayed below them in its @@ -265,6 +270,10 @@ subclass:: ``fields`` can contain values defined in :attr:`~ModelAdmin.readonly_fields` to be displayed as read-only. + If you add a callable name to ``fields``, the same rule applies as + with :attr:`~ModelAdmin.fields` option: the callable must be + specified in :attr:`~ModelAdmin.readonly_fields`. + * ``classes`` A list containing extra CSS classes to apply to the fieldset. |
