Try this - *Player.objects.filter(country__in=**
Nationality.objects.filter(name='Espanhola').distinct('country').values('country'))
*


2013/10/9 Hélio Miranda <helio...@gmail.com>

> yes, that was it ...
> Just one more thing, if I would like to create the nationality of the
> player, so that the filter is:
> *
> Player.objects.filter(country__in=Country.objects.filter(nationality__in=Nationality.objects.filter(name='Espanhola')))
> *
> *
> *
> where only the step nationality, as I do, not only gives an if?
>
> --
> 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/caaaa8a6-6f7f-4603-9834-c94e426208e0%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CA%2BX6QOVx4ad26UpgA6YEPvQy%3DjNiNfQADgaAPW%2B%2BBNe4xBtexQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to