Ticket #11789: 11789.diff
File 11789.diff, 1.1 KB (added by , 15 years ago) |
---|
-
django/db/models/query.py
1105 1105 Don't update anything. 1106 1106 """ 1107 1107 return 0 1108 1109 def aggregate(self, *args, **kwargs): 1110 """ 1111 Returns a dict mapping the aggregate names to None 1112 """ 1113 for arg in args: 1114 kwargs[arg.default_alias] = arg 1115 return dict([(key, None) for key in kwargs]) 1108 1116 1109 1117 # EmptyQuerySet is always an empty result in where-clauses (and similar 1110 1118 # situations). -
tests/regressiontests/aggregation_regress/models.py
318 318 ... 319 319 FieldError: Cannot compute Avg('mean_age'): 'mean_age' is an aggregate 320 320 321 # Regression for 11789 - Aggregates ignore none() 322 >>> Author.objects.none().aggregate(Avg('age')) 323 {'age__avg': None} 324 321 325 """ 322 326 } 323 327