﻿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
20939	Convert QuerySet to Query when filtering	Anssi Kääriäinen	nobody	"The current ORM coding has very similar, yet not equivalent paths for using QuerySet and the internal Query when doing filter(something=queryset_or_query). It seems that converting a QuerySet to Query early on would lead to cleaner implementation. Proof of concept here: https://github.com/akaariai/django/tree/queryset_to_query_in_filter

There are two problems in the current implementation:
  - The way user-defined .values() and Django issued .values() in build_filter() is detected is ugly
  - There is no multidb protection (test_subquery in multiple_database.tests.QueryTestCase) fails).

I'll mark this as accepted directly in the sense of ""worth doing if above problems can be addressed).
"	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	fixed			Accepted	0	0	0	0	0	0
