summaryrefslogtreecommitdiff
path: root/docs/model-api.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-09-20 02:37:39 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-09-20 02:37:39 +0000
commit1d65ba62dbfb9e6f13bccbf03bf9444c6c6d6481 (patch)
tree1cd56a1a2636f75b7f5f842beffb42c1c99c4c78 /docs/model-api.txt
parent473306a6589697d2c977373207254d89dea2133f (diff)
Added a few notes about list_display to docs/model-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@649 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/model-api.txt')
-rw-r--r--docs/model-api.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/model-api.txt b/docs/model-api.txt
index 7eda8c95c1..918f4eb5db 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -786,8 +786,11 @@ object, which takes the following parameters. All are optional.
There are a few special cases that do other things besides displaying the
contents of the given fields:
- * If the field given has a relationship, that relationship is
- followed and the ``repr()`` of the related object is displayed.
+ * If the field given is a ``ForeignKey``, the ``repr()`` of the related
+ object will be displayed.
+
+ * ``ManyToManyField`` fields aren't supported, because that would
+ entail executing a separate SQL statement for each row in the table.
* If the field is a ``BooleanField``, a "on" or "off" icon will
be displayed instead of ``True`` or ``False``.
@@ -797,6 +800,11 @@ object, which takes the following parameters. All are optional.
``short_description`` function attribute, for use as the header for
the field.
+ * Use the string ``"__repr__"`` to output the representation of the
+ object, according to your model's ``__repr__()`` function. If you
+ don't define ``list_display``, Django will use the ``__repr__`` by
+ default.
+
See the example below.
``list_filter``