HI there.. Looks like you already have the person ID , you don't need hit the database every time to call Person object. You can make faster only check for ID not Person object.
instead this: person = Person.objects.get(name=person_name) choices_for_person_on_date = Choice.objects.filter(date=dater).filter(person=person) You can do this choices_for_person_on_date = Choice.objects.get(date=dater,person_id = to_email_i_am_looking) and if you want the joins Choice.objects.get(date=dater,person_id = to_email_i_am_looking).select_related('person') On Mon, Oct 13, 2014 at 4:21 AM, dk <demi...@gmail.com> wrote: > I will give a try, how does django know that have to join using double > filter? or it just auto-magically knows behind the hood? > or filtering by another model/class django get the idea, and joins the > tables? > > Thanks Tom =) > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/a481b35d-a1db-497c-a39d-2519213500a5%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/a481b35d-a1db-497c-a39d-2519213500a5%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Anderson Dias Borges Senior Analyst Developer Tu cumprirás o desejo do meu coração se eu Te buscar... I can't see but I'll take my chances To hear You call my name -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAin48VvcLj7FxqvfgJmEb_tmgUToSf_3cGw9-S345cMAjSdqA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.