﻿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
175	select_related does not work in both directions..	Justin	Adrian Holovaty	"comparing the following two statements:

{{{
>>> for p in   polls.get_list(select_related=True): print p, p.get_choice_list()
>>> for c in choices.get_list(select_related=True): print c.get_poll(), c
}}}
The first statement runs one query per poll, while the second runs one query no matter how many polls you have.

This seems to be because the information about what models are related to each other does not get added to both ends of the relationship... now this is not 100% true because a poll obviously knows about what choices reference it...

My guess is that there needs to be a OneToMany class that compliments the ManyToOne relationship, letting the Poll class know that select_related should pull in choices."	defect	closed	Database layer (models, ORM)		normal	wontfix	select_related		Unreviewed	0	0	0	0	0	0
