[1.2.X] Expanded InlineModelAdmin documentation a bit. Partial backport of [14882].

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15595 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ramiro Morales 2011-02-20 15:27:01 +00:00
parent 6ef2b4c2da
commit d65ca449ac

View File

@ -172,7 +172,7 @@ The ``field_options`` dictionary can have the following keys:
.. versionadded:: 1.2 .. versionadded:: 1.2
``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.
* ``classes`` * ``classes``
A list containing extra CSS classes to apply to the fieldset. A list containing extra CSS classes to apply to the fieldset.
@ -488,9 +488,9 @@ See ``InlineModelAdmin`` objects below.
.. attribute:: ModelAdmin.ordering .. attribute:: ModelAdmin.ordering
Set ``ordering`` to specify how objects on the admin change list page should be Set ``ordering`` to specify how lists of objects should be ordered in the
ordered. This should be a list or tuple in the same format as a model's Django admin views. This should be a list or tuple in the same format as a
``ordering`` parameter. model's ``ordering`` parameter.
If this isn't provided, the Django admin will use the model's default ordering. If this isn't provided, the Django admin will use the model's default ordering.
@ -1088,8 +1088,31 @@ The difference between these two is merely the template used to render them.
``InlineModelAdmin`` options ``InlineModelAdmin`` options
----------------------------- -----------------------------
The ``InlineModelAdmin`` class is a subclass of ``ModelAdmin`` so it inherits ``InlineModelAdmin`` shares many of the same features as ``ModelAdmin``, and
all the same functionality as well as some of its own: adds some of its own (the shared features are actually defined in the
``BaseModelAdmin`` superclass). The shared features are:
- :attr:`~InlineModelAdmin.form`
- :attr:`~ModelAdmin.fieldsets`
- :attr:`~ModelAdmin.fields`
- :attr:`~ModelAdmin.exclude`
- :attr:`~ModelAdmin.filter_horizontal`
- :attr:`~ModelAdmin.filter_vertical`
- :attr:`~ModelAdmin.prepopulated_fields`
- :attr:`~ModelAdmin.radio_fields`
- :attr:`~InlineModelAdmin.raw_id_fields`
.. versionadded:: 1.1
- :meth:`~ModelAdmin.formfield_for_foreignkey`
- :meth:`~ModelAdmin.formfield_for_manytomany`
.. versionadded:: 1.2
- :attr:`~ModelAdmin.readonly_fields`
- :attr:`~ModelAdmin.formfield_overrides`
The ``InlineModelAdmin`` class adds:
.. attribute:: InlineModelAdmin.model .. attribute:: InlineModelAdmin.model
@ -1117,7 +1140,6 @@ all the same functionality as well as some of its own:
.. attribute:: InlineModelAdmin.extra .. attribute:: InlineModelAdmin.extra
This controls the number of extra forms the formset will display in addition This controls the number of extra forms the formset will display in addition
to the initial forms. See the to the initial forms. See the
:doc:`formsets documentation </topics/forms/formsets>` for more information. :doc:`formsets documentation </topics/forms/formsets>` for more information.