Re: ModelChoiceField and initial value

2009-02-23 Thread Brandon Taylor
Solved: ModelChoiceField(empty_label=None) On Feb 23, 9:14 pm, Brandon Taylor wrote: > Hi everyone, > > What's the trick to getting a ModelChoiceField to use the first object > in a QuerySet as the initial value to get rid of -? > > If I do: > qs =

ModelChoiceField and initial value

2009-02-23 Thread Brandon Taylor
Hi everyone, What's the trick to getting a ModelChoiceField to use the first object in a QuerySet as the initial value to get rid of -? If I do: qs = Model.objects.all() my_field = forms.ModelChoiceField(queryset=qs, initial=qs[0]) I still get -- as the first choice. TIA,