If I have a QuerySet like this:

>>> o1 = Store.objects.all()
>>> for o2 in o1:
...    o2.employees.all()
...
[<Employee: Adam>, ...]


Is there any way to get all employees for all stores without having to
do the for (in other words some sort of one line solution)?  I seem to
need to do this frequently and it seems wasteful  Something like
o1.employees.all() would be ideal but if o1 is a QuerySet, that won't
work.

Thanks for any help, even if I can just get a definitive 'no - that's
the best way to do it'.

-Adam
--~--~---------~--~----~------------~-------~--~----~
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