﻿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
26658	"""When Case"" query generating rule in duplicate"	imaia	nobody	"I have a query that looks like this:

Model.objects.values('field').annotate(value=When(Case(something=number, then=1), default=0, output_field=IntegerField())).annotate(count=Count('field'), mysum=Sum('value'))

The query above generates the ""When Case"" clause twice. Once for value and another time at the end of the query. That can be verified evaluating the '''str(queryset.query)'''. "	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed		josh.smeaton@…	Unreviewed	0	0	0	0	0	0
