Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
Karen Tracey authored April 16, 2010
4  tests/modeltests/aggregation/models.py
@@ -191,7 +191,7 @@ def __unicode__(self):
191 191
 
192 192
 # Calling values on a queryset that has annotations returns the output
193 193
 # as a dictionary
194  
->>> [sorted(o.iteritems()) for o in Book.objects.filter(pk=1).annotate(mean_age=Avg('authors__age')).values()]
  194
+>>> [sorted(o.items()) for o in Book.objects.filter(pk=1).annotate(mean_age=Avg('authors__age')).values()]
195 195
 [[('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)]]
196 196
 
197 197
 >>> Book.objects.filter(pk=1).annotate(mean_age=Avg('authors__age')).values('pk', 'isbn', 'mean_age')
@@ -203,7 +203,7 @@ def __unicode__(self):
203 203
 
204 204
 # An empty values() call before annotating has the same effect as an
205 205
 # empty values() call after annotating
206  
->>> [sorted(o.iteritems()) for o in Book.objects.filter(pk=1).values().annotate(mean_age=Avg('authors__age'))]
  206
+>>> [sorted(o.items()) for o in Book.objects.filter(pk=1).values().annotate(mean_age=Avg('authors__age'))]
207 207
 [[('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)]]
208 208
 
209 209
 # Calling annotate() on a ValuesQuerySet annotates over the groups of
2  tests/regressiontests/aggregation_regress/models.py
@@ -174,7 +174,7 @@ def __unicode__(self):
174 174
 {'number': 1132, 'select': 1132}
175 175
 
176 176
 # Regression for #10064: select_related() plays nice with aggregates
177  
->>> sorted(Book.objects.select_related('publisher').annotate(num_authors=Count('authors')).values()[0].iteritems())
  177
+>>> sorted(Book.objects.select_related('publisher').annotate(num_authors=Count('authors')).values()[0].items())
178 178
 [('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)]
179 179
 
180 180
 # Regression for #10010: exclude on an aggregate field is correctly negated

0 notes on commit f6b6e0f

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