Re: Performance when retrieving data from related models

2013-03-19 Thread Taras D
Thanks again! On 19 March 2013 13:09, Peter of the Norse wrote: > [snip] > > We might put the onus on the client to call: > qs = getTendersForContractor(contractor) > for tender in list(qs.prefetch_related('project', 'project__contract', > 'project__contract')): > print tender, tender.getTot

Re: Performance when retrieving data from related models

2013-03-18 Thread Taras D
Hi Peter On 18 March 2013 16:35, Peter of the Norse wrote: > You’re over thinking this by a large margin. getTendersForContractor > should return a QuerySet. That way you can add things like .select_related > as necessary in the view. > > Also, I’m a bit worried about the fact you have a functio