1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

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
This commit is contained in:
Adrian Holovaty
2005-07-21 03:46:16 +00:00
parent 304b08e325
commit c21f6ecee2
6 changed files with 24 additions and 41 deletions

View File

@@ -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