Re: Default Selection in ChoiceField

2010-02-02 Thread Sumanth
Thanks guys Both work Sumanth On Feb 1, 11:09 pm, Shawn Milochik wrote: > You can do it in your view after creating the form, if you like. > > form = SomeForm() > form.fields['meal_pref'].initial = 2 > > Shawn -- You received this message because you are subscribed to the Google Groups "Djang

Re: Default Selection in ChoiceField

2010-02-01 Thread Shawn Milochik
You can do it in your view after creating the form, if you like. form = SomeForm() form.fields['meal_pref'].initial = 2 Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. T

Re: Default Selection in ChoiceField

2010-02-01 Thread Rishabh Manocha
On Tue, Feb 2, 2010 at 8:56 AM, Sumanth wrote: > Hi all, > > I  have a basic form > > class AssumptionsForm(forms.Form): >       writedownoper  = forms.ChoiceField( required=True, choices = > [('1','1'),('2',2='),('3','3')]) > > Now in my view after I create the form I want to set value 2 as > def