I have 2 querysets:

events = event_dates.objects.select_related('evid', 'evid__type',
'evid__category').all()
inner_qs = event_dates.objects.all().values('pk').query
loc = locations.objects.filter(locid__in=inner_qs).all()
render_to_response('backup.xml', {'events': events, 'locations': loc,
'conn': connection}, mimetype='text/xml')

if I only loop events or loc on my template I only have 2 selects (one
"normal" and one witha "where .. in ()"

if I loop events and loc in 2 seperate loops (not nested) I get 1
select for events and as much selects for loc as rows in the result of
the second query - no
IN select is generated instead each row is fetched itself.

how can I prevent this?

-- Hinnack
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to