mirror of https://github.com/django/django.git
Minor edits to some recently-added admin docs.
This commit is contained in:
parent
7b49da1c38
commit
8f839aaa18
|
@ -186,10 +186,10 @@ subclass::
|
||||||
values defined in :attr:`ModelAdmin.readonly_fields` to be displayed as
|
values defined in :attr:`ModelAdmin.readonly_fields` to be displayed as
|
||||||
read-only.
|
read-only.
|
||||||
|
|
||||||
The ``fields`` option, unlike :attr:`~ModelAdmin.list_display`, may contain
|
The ``fields`` option, unlike :attr:`~ModelAdmin.list_display`, may only
|
||||||
only field names of the model or the form specified by
|
contain names of fields on the model or the form specified by
|
||||||
:attr:`~ModelAdmin.form`, not callables. However it *can* contain callables
|
:attr:`~ModelAdmin.form`. It may contain callables only if they are listed
|
||||||
if they are defined in :attr:`~ModelAdmin.readonly_fields`.
|
in :attr:`~ModelAdmin.readonly_fields`.
|
||||||
|
|
||||||
To display multiple fields on the same line, wrap those fields in their own
|
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
|
tuple. In this example, the ``url`` and ``title`` fields will display on the
|
||||||
|
@ -258,10 +258,10 @@ subclass::
|
||||||
'fields': ('first_name', 'last_name', 'address', 'city', 'state'),
|
'fields': ('first_name', 'last_name', 'address', 'city', 'state'),
|
||||||
}
|
}
|
||||||
|
|
||||||
Just like with the :attr:`~ModelAdmin.fields` option, to display
|
As with the :attr:`~ModelAdmin.fields` option, to display multiple
|
||||||
multiple fields on the same line, wrap those fields in their own
|
fields on the same line, wrap those fields in their own tuple. In this
|
||||||
tuple. In this example, the ``first_name`` and ``last_name`` fields
|
example, the ``first_name`` and ``last_name`` fields will display on
|
||||||
will display on the same line::
|
the same line::
|
||||||
|
|
||||||
{
|
{
|
||||||
'fields': (('first_name', 'last_name'), 'address', 'city', 'state'),
|
'fields': (('first_name', 'last_name'), 'address', 'city', 'state'),
|
||||||
|
@ -270,9 +270,9 @@ subclass::
|
||||||
``fields`` can contain values defined in
|
``fields`` can contain values defined in
|
||||||
:attr:`~ModelAdmin.readonly_fields` to be displayed as read-only.
|
:attr:`~ModelAdmin.readonly_fields` to be displayed as read-only.
|
||||||
|
|
||||||
If you add a callable name to ``fields``, the same rule applies as
|
If you add the name of a callable to ``fields``, the same rule applies
|
||||||
with :attr:`~ModelAdmin.fields` option: the callable must be
|
as with the :attr:`~ModelAdmin.fields` option: the callable must be
|
||||||
specified in :attr:`~ModelAdmin.readonly_fields`.
|
listed in :attr:`~ModelAdmin.readonly_fields`.
|
||||||
|
|
||||||
* ``classes``
|
* ``classes``
|
||||||
A list containing extra CSS classes to apply to the fieldset.
|
A list containing extra CSS classes to apply to the fieldset.
|
||||||
|
|
Loading…
Reference in New Issue