summaryrefslogtreecommitdiff
path: root/docs/model-api.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-07-22 18:45:22 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-07-22 18:45:22 +0000
commitc2a5c49ac279f1e0e2cdbec3de0d957893b9c839 (patch)
tree072469cdeab1caa3b040f27a3806bfeb774b53e0 /docs/model-api.txt
parentc97efb6799168c8903fc1181ecada7fe9932dd1f (diff)
Fixed #153 -- Changed docs to use new ordering syntax
git-svn-id: http://code.djangoproject.com/svn/django/trunk@299 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/model-api.txt')
-rw-r--r--docs/model-api.txt10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/model-api.txt b/docs/model-api.txt
index a38e248dd8..283abbd924 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -76,11 +76,11 @@ wide array of options, only ``fields`` is required.
``ordering``
The default ordering for the object, for use by ``get_list`` and the admin::
- ordering = (('order_date', 'DESC'),)
+ ordering = ['-order_date']
- This is a tuple of 2-tuples. Each 2-tuple is ``(field_name, ordering_type)``
- where ordering_type is either ``"ASC"`` or ``"DESC"``. You can also use the
- ``(None, "RANDOM")`` for random ordering.
+ This is a tuple or list of strings. Each string is a field name with an
+ optional "-" (indicating descending order). Or, you can use the string "?"
+ to order randomly.
``permissions``
Extra permissions to enter into the permissions table when creating this
@@ -662,7 +662,7 @@ object, which has the following options. All are optional.
(This example also has ``search_fields`` defined; see below).
``ordering``
- An ordering tuple (see the `Options for models`_, above) that gives a
+ A list or tuple (see the `Options for models`_, above) that gives a
different ordering for the admin change list. If this isn't given, the
model's default ordering will be used.