Re: Initial data for dynamic field

2011-12-23 Thread Martin Tiršel
On Fri, 23 Dec 2011 09:42:37 +0100, Mengu wrote: you need to set "initial" attribute of TypedChoiceField. Thanks, I knew about the initial only on form instance and not on field :) On Dec 23, 10:34 am, Martin Tiršel wrote: Hello, I have: class

Re: Initial data for dynamic field

2011-12-23 Thread Mengu
you need to set "initial" attribute of TypedChoiceField. On Dec 23, 10:34 am, Martin Tiršel wrote: > Hello, > > I have: > > class SomeForm(forms.Form): >      ... > >      def __init__(self, *args, **kwargs): >          ... >          super(SomeForm, self).__init__(*args,

Initial data for dynamic field

2011-12-23 Thread Martin Tiršel
Hello, I have: class SomeForm(forms.Form): ... def __init__(self, *args, **kwargs): ... super(SomeForm, self).__init__(*args, **kwargs) ... self.fields['starting_location'] = forms.TypedChoiceField( label=_('Starting location'),