From a666b987835e99c55f51cd2feaf287111cbfcd86 Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Tue, 23 May 2006 19:55:30 +0000 Subject: Fixed bug with Meta.ordering being ignored when slicing a single item off a QuerySet. Thanks, Gábor Fawkes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://code.djangoproject.com/svn/django/trunk@2970 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/ordering/models.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/modeltests/ordering/models.py b/tests/modeltests/ordering/models.py index de08a75755..8b56731c55 100644 --- a/tests/modeltests/ordering/models.py +++ b/tests/modeltests/ordering/models.py @@ -56,6 +56,10 @@ API_TESTS = """ >>> Article.objects.order_by('headline')[1:3] [Article 2, Article 3] +# Getting a single item should work too: +>>> Article.objects.all()[0] +Article 4 + # Use '?' to order randomly. (We're using [...] in the output to indicate we # don't know what order the output will be in. >>> Article.objects.order_by('?') -- cgit v1.3