Commits

Anonymous committed 062d192

Added some examples to 'ordering' section of docs/model-api.txt

Comments (0)

Files changed (1)

docs/model-api.txt

     optional "-" prefix, which indicates descending order. Fields without a
     leading "-" will be ordered ascending. Use the string "?" to order randomly.
 
-    See `Specifying ordering`_ for a full example.
+    For example, to order by a ``pub_date`` field ascending, use this::
+
+        ordering = ['pub_date']
+
+    To order by ``pub_date`` descending, use this::
+
+        ordering = ['-pub_date']
+
+    To order by ``pub_date`` descending, then by ``author`` ascending, use this::
+
+        ordering = ['-pub_date', 'author']
+
+    See `Specifying ordering`_ for more examples.
 
     .. _Specifying ordering: http://www.djangoproject.com/documentation/models/ordering/