Re: Dynamic queryset to ModelChoiceField

2008-04-15 Thread Alex Koshelev
Or `Topic.objects.none()` On Apr 15, 8:46 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Sure, just give the modelchoicefield Topic.objects.all() to start > with, as this will never actually get used. > > On Apr 14, 11:14 pm, shabda <[EMAIL PROTECTED]> wrote: > > > I have a form where I

Re: Dynamic queryset to ModelChoiceField

2008-04-14 Thread [EMAIL PROTECTED]
Sure, just give the modelchoicefield Topic.objects.all() to start with, as this will never actually get used. On Apr 14, 11:14 pm, shabda <[EMAIL PROTECTED]> wrote: > I have a form where I want to do something like, > > class SetDefaultForm(forms.Form): >     topics = forms.ModelChoiceField() >

Dynamic queryset to ModelChoiceField

2008-04-14 Thread shabda
I have a form where I want to do something like, class SetDefaultForm(forms.Form): topics = forms.ModelChoiceField() def __init__(self, user): super(SetDefaultForm, self).__init__() self.fields['topics'].queryset = Topic.objects.filter(user) This does not work, of