hi,

I have a model called Matchentry which has foreign keys to the Match model and 
the Player model. When making a new Matchentry, obviously the choices have to 
be limited to the players who have not already been entered. I used to do this 
manually using plain python, but do we have a queryset that can do this? 

to make it clear: select all players who are not entered in a specific match. 
Manually I would do:

get all the matchentries for a specfic tournament and use player_set.all() to 
get a list of already entered players. Then build the CHOICES list by 
excluding all the already entered players.

a query like: Player.objects.exclude(all players in 
matchentry.player_set.all())


-- 
regards
Kenneth Gonsalves
Senior Project Officer
NRC-FOSS
http://nrcfosshelpline.in/web/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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