Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.1.X] Fixed #13360: For Python2.3 compatbility, don't pass iterator…

…s to sorted.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12994 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f6b6e0f1d9c4440d848c71a933fbe4ecf67ce106 1 parent e7ef1b2
@kmtracey kmtracey authored
View
4 tests/modeltests/aggregation/models.py
@@ -191,7 +191,7 @@ def __unicode__(self):
# Calling values on a queryset that has annotations returns the output
# as a dictionary
->>> [sorted(o.iteritems()) for o in Book.objects.filter(pk=1).annotate(mean_age=Avg('authors__age')).values()]
+>>> [sorted(o.items()) for o in Book.objects.filter(pk=1).annotate(mean_age=Avg('authors__age')).values()]
[[('contact_id', 1), ('id', 1), ('isbn', u'159059725'), ('mean_age', 34.5), ('name', u'The Definitive Guide to Django: Web Development Done Right'), ('pages', 447), ('price', Decimal("30...")), ('pubdate', datetime.date(2007, 12, 6)), ('publisher_id', 1), ('rating', 4.5)]]
>>> Book.objects.filter(pk=1).annotate(mean_age=Avg('authors__age')).values('pk', 'isbn', 'mean_age')
@@ -203,7 +203,7 @@ def __unicode__(self):
# An empty values() call before annotating has the same effect as an
# empty values() call after annotating
->>> [sorted(o.iteritems()) for o in Book.objects.filter(pk=1).values().annotate(mean_age=Avg('authors__age'))]
+>>> [sorted(o.items()) for o in Book.objects.filter(pk=1).values().annotate(mean_age=Avg('authors__age'))]
[[('contact_id', 1), ('id', 1), ('isbn', u'159059725'), ('mean_age', 34.5), ('name', u'The Definitive Guide to Django: Web Development Done Right'), ('pages', 447), ('price', Decimal("30...")), ('pubdate', datetime.date(2007, 12, 6)), ('publisher_id', 1), ('rating', 4.5)]]
# Calling annotate() on a ValuesQuerySet annotates over the groups of
View
2  tests/regressiontests/aggregation_regress/models.py
@@ -174,7 +174,7 @@ def __unicode__(self):
{'number': 1132, 'select': 1132}
# Regression for #10064: select_related() plays nice with aggregates
->>> sorted(Book.objects.select_related('publisher').annotate(num_authors=Count('authors')).values()[0].iteritems())
+>>> sorted(Book.objects.select_related('publisher').annotate(num_authors=Count('authors')).values()[0].items())
[('contact_id', 8), ('id', 5), ('isbn', u'013790395'), ('name', u'Artificial Intelligence: A Modern Approach'), ('num_authors', 2), ('pages', 1132), ('price', Decimal("82.8...")), ('pubdate', datetime.date(1995, 1, 15)), ('publisher_id', 3), ('rating', 4.0)]
# Regression for #10010: exclude on an aggregate field is correctly negated

0 comments on commit f6b6e0f

Please sign in to comment.
Something went wrong with that request. Please try again.