On 8 Lis, 18:06, Victor <psyco...@gmail.com> wrote: > Hi, > > > user_item_rel_set is a m2m relationship between the User and Item > class. For every item, I look back at its m2m relationship model and > retrieve payment_amount. The only problem is, select_related() > doesn't grab the user_item_rel_set.all() when I query for the items > (where items=Item.objects.select_related().all() ). Is there anything > I can do to speed this up? It's *very* slow.
I'm not sure what you're trying to do, but what about: items_user = Item.objects.filter(user=u) items_buyer = Item.objects.filter(buyer=u) - and then do something with those lists? -- Tomasz Zieliński http://pyconsultant.eu --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---