﻿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
28281	Queryset.count() with a union takes the first id of the results objects	Amir Tugendhaft	nobody	"I have a query I built with 2 querysets with a union between them, and I get a wrong count for them.
For each one of them the queryset.count() is correct, but after the union the queryset.count() is the first id of the objects results.
I used queeryset.query to see the raw query and its fine.

I'm attaching 2 photos so you could see the problem:

The first - showing 33 results is when I used '|' with the 2 querysets. 
This workaround is not good for me, since the UNION's advantage is that I get the first query's results on top of the rest

The second - showing 25103 results is when I used the .union()


"	Bug	closed	Database layer (models, ORM)	1.11	Normal	duplicate	Queryset, count, union		Unreviewed	0	0	0	0	0	0
