﻿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
17821	Extra fields on many-to-many relationships	jedlau@…	nobody	"'''Existing text'''
{{{
As you are using an intermediate model, you can also query on its attributes:

# Find all the members of the Beatles that joined after 1 Jan 1961
>>> Person.objects.filter(
...     group__name='The Beatles',
...     membership__date_joined__gt=date(1961,1,1))
[<Person: Ringo Starr]
}}}

'''Bug Description'''
I'm surprised that this query worked, since Person doesn't have a group attribute. I think the group attribute is supposed to be reached through the intermediate model, membership:
{{{
# Find all the members of the Beatles that joined after 1 Jan 1961
>>> Person.objects.filter(
...     membership__group__name='The Beatles',
...     membership__date_joined__gt=date(1961,1,1))
[<Person: Ringo Starr]
}}}"	Bug	closed	Documentation	dev	Normal	invalid	many-to-many intermediate model		Unreviewed	0	0	0	0	1	0
