Re: Filter model and retrieve associated model/objects at same time

2009-01-19 Thread Malcolm Tredinnick
On Mon, 2009-01-19 at 12:27 -0800, sico wrote: [...] > I haven't checked but assuming this is going to execute 2 sql commands > for each row returned by the first query not good!! > Is there a way to tell django/python that I want to retrieve the > related data from the other 2 models before

Re: Filter model and retrieve associated model/objects at same time

2009-01-19 Thread sico
btw... using 0.96 here... On Jan 20, 9:27 am, sico wrote: > Hi, > > I'm filtering a model on some criteria... and based on the resultset I > want to retrieve associated related models (all one-to-one > relationships) > > Whats the most efficient way to do this without

Filter model and retrieve associated model/objects at same time

2009-01-19 Thread sico
Hi, I'm filtering a model on some criteria... and based on the resultset I want to retrieve associated related models (all one-to-one relationships) Whats the most efficient way to do this without resorting to custom SQL? this is the best I can come up with: obj1s =