From c21f6ecee24c6587bb8ddddc878aad3fd29b40a7 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 21 Jul 2005 03:46:16 +0000 Subject: 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 --- docs/model-api.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'docs/model-api.txt') 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 -- cgit v1.3