Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added 'limit' and 'offset' unit tests, one of which fails in MySQL 3 …

…(refs #350)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@540 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9180112f021d0a2a16e29565ece4f137a1a99823 1 parent 00c6aca
@adrianholovaty adrianholovaty authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 tests/testapp/models/ordering.py
View
8 tests/testapp/models/ordering.py
@@ -48,4 +48,12 @@ def __repr__(self):
[Article 1, Article 2, Article 3, Article 4]
>>> articles.get_list(order_by=['pub_date', '-headline'])
[Article 1, Article 3, Article 2, Article 4]
+
+# Use the "limit" parameter to limit the results.
+>>> articles.get_list(order_by=['headline'], limit=2)
+[Article 1, Article 2]
+
+# Use the "offset" parameter with "limit" to offset the result list.
+>>> articles.get_list(order_by=['headline'], offset=1, limit=2)
+[Article 2, Article 3]
"""
Please sign in to comment.
Something went wrong with that request. Please try again.