summaryrefslogtreecommitdiff
path: root/docs/model-api.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-07-21 03:46:16 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-07-21 03:46:16 +0000
commitc21f6ecee24c6587bb8ddddc878aad3fd29b40a7 (patch)
treec419bdcc72c6e001a58dda127035474cf1800973 /docs/model-api.txt
parent304b08e3254f7c46999d1204ce9968c00ad088eb (diff)
Fixed #92 -- meta.Admin 'fields' parameter is now optional. If it's not given, Django will use all editable fields by default. This cuts down on redundancy. Also updated relevant docs to reflect the change.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@265 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/model-api.txt')
-rw-r--r--docs/model-api.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/docs/model-api.txt b/docs/model-api.txt
index e52ca8b43d..a2cfade854 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -304,9 +304,9 @@ Field Types
many toppings on a pizza)::
meta.ForeignKey(Pizza)
-
+
.. admonition:: Note
-
+
To create a recursive relationship, use a ``ForeignKey`` that relates
to ``"self"`` (i.e. ``meta.ForeignKey("self")``).
@@ -568,7 +568,7 @@ Admin options
The ``admin`` field in the model tells Django how to construct the admin
interface for the object. The field is an instance of the ``meta.Admin``
-object, which has the following options (of which only ``fields`` is required):
+object, which has the following options. All are optional.
``date_hierarchy``
To allow filtering of objects in the admin by date, set ``date_hierarchy``
@@ -616,6 +616,11 @@ object, which has the following options (of which only ``fields`` is required):
.. image:: http://media.djangoproject.com/img/doc/flatfiles_admin.png
+ If ``fields`` isn't given but a model does define ``admin`` as a
+ ``meta.Admin`` object, Django will default to displaying each field that
+ isn't an ``AutoField`` and has ``editable=True``, in a single fieldset, in
+ the same order as the ``fields`` in the model.
+
``js``
A list of strings representing URLs of JavaScript files to link into the
admin screen. This can be used to tweak a given type of admin page in JS or