﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11671	Aggregations add extra values to ValuesQuerySets :: another usecase	richard@…		"Looking at #10132 I see a similar complaint, however, in this case... the extra.select variable is not included in the values/group_by but is annotated.


{{{
>>> qs = TblCdr.objects.extra(select={'billable':'IF(billsec=0,0,1)'},).values('network').annotate(Sum('billable')
... )
Traceback (most recent call last):
  File ""<console>"", line 1, in <module>
  File ""/usr/lib/python2.5/site-packages/django/db/models/query.py"", line 580, in annotate
    is_summary=False)
  File ""/usr/lib/python2.5/site-packages/django/db/models/sql/query.py"", line 1471, in add_aggregate
    field_list, opts, self.get_initial_alias(), False)
  File ""/usr/lib/python2.5/site-packages/django/db/models/sql/query.py"", line 1737, in setup_joins
    ""Choices are: %s"" % (name, "", "".join(names)))
FieldError: Cannot resolve keyword 'billable' into field. Choices are: billsec, cause, cli, codec, country_code, dcontext, disposition, dst, duration, end, id, ip, lastapp, network, note, start, supplier
}}}

"	Bug	closed	Database layer (models, ORM)	dev	Normal	wontfix	QuerySet.extra	klemens@… jorgecarleitao@…	Accepted	0	0	0	0	0	0
