hi,
I have two models called Child and Sponsor. There is a model called
Sponsorship which has foreign keys to Child and Sponsor. For the
foreign key to Child, I want to limit choices to all those children
who are *not* already a foreign key to sponsorship and who are
active. This is the query I generate to get this list:
Child.objects.extra(
where=["""id not in(select child_id from web_sponsorship\
where web_sponsorship.iscurrent=True)"""]
).filter(iscurrent=True)
how do i get this into the limit_choices_to dictionary?
--
regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common man: http://registration.fossconf.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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---