Changes between Initial Version and Version 1 of Ticket #19493
- Timestamp:
- Dec 18, 2012, 7:17:23 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #19493 – Description
initial v1 2 2 models.SomeModel.objects.filter(somecharfield=value).values("someintegerfield").annotate(Count("someintegerfield")) 3 3 4 return a QuerySet with no aggregate count, but multiple rows with someintegerfield__count=14 return a QuerySet with no aggregate count, but multiple rows with `someintegerfield__count=1` 5 5 6 The correct SQL would be: SELECT tablespace_somemodel.someintegerfield,COUNT(tablespace_somemodel.someintegerfield) AS someintegerfield__count FROM tablespace_somemodel WHERE tablespace_somemodel.somecharfield = 'value' GROUP BY tablespace_somemodel.someintegerfield; 6 The correct SQL would be: 7 {{{ 8 SELECT tablespace_somemodel.someintegerfield, COUNT(tablespace_somemodel.someintegerfield) AS someintegerfield__count 9 FROM tablespace_somemodel WHERE tablespace_somemodel.somecharfield = 'value' 10 GROUP BY tablespace_somemodel.someintegerfield; 11 }}} 7 12 8 13 This works fine on other backends.