hi,

this is my code snippet:

class Ingredientrecform(forms.ModelForm):
     """
     Form to add Ingredients.
     """
     def __init__(self,pageid, *args, **kwargs):
             super(Ingredientrecform, self).__init__(*args, **kwargs)
             self.pageid = pageid
             ingredient = forms.ModelChoiceField 
(queryset=Ingredient.objects.extra(
                 where=["""id not in (select ingredient_id from  
web_recipeingredient\
                 where recipe_id = %s)""" % self.pageid]))


     class Meta:
         model = Recipeingredient
         exclude = ('rank','recipe')

the problem is that all the ingredients get displayed in the choice  
dropdown and not only the ingredients that pass the test in the  
queryset. Where am I going wrong?

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/code/




--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to