Hi
I am trying to create a ModelForm with a ModelChoiceField which has a
should have a limited queryset that is filtered by the userprofile
logged in, so far i have this:
class AddMemberForm(forms.ModelForm):
member =
forms.ModelChoiceField(Member.objects.filter(userprofile=userprofile))
class Meta:
model = ProductMember
exclude = ('product')
How do I go about getting the 'userprofile' varible in to this class?
Or is there some better other way to do this?
Thanks in advance
Dan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---