﻿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
17748	Wrong lookup in the aggregation examples	yliharma	nobody	"The example lookup in https://docs.djangoproject.com/en/1.3/topics/db/aggregation/#order-of-annotate-and-filter-clauses
is wrong:
{{{
>>> Publisher.objects.annotate(num_books=Count('book')).filter(book__rating__gt=3.0)
and the query:

>>> Publisher.objects.filter(book__rating__gt=3.0).annotate(num_books=Count('book'))
}}}
because the model Publisher doesn't contain any ForeignKey to the model Book (while the reverse is True).
It should be:

{{{
>>> Publisher.objects.annotate(num_books=Count('book')).filter(book_set__rating__gt=3.0)
and the query:

>>> Publisher.objects.filter(book_set__rating__gt=3.0).annotate(num_books=Count('book'))
}}}"	Bug	closed	Documentation	1.3	Normal	invalid			Unreviewed	0	0	0	0	0	0
