I can't see to figure out how to do something fairly simple - set the
initial value of a model form field at runtime. The form is a simple set of
radio buttons that lets the user choose which project to work on. I'm
storing the selection in a session variable and that's working fine. What I
can'
Just use "initial" keyword on creation form
class myForm(forms.Form):
test = forms.CharField(label = _('test'), max_length=255, required =
True)
myForm(initial = {'test': 'test string'}).
If you use form that generated from model:
class myForm(forms.Form):
class Meta:
model = myMod
On Wed, Nov 18, 2009 at 2:01 AM, Ilya Polosuhin wrote:
> Just use "initial" keyword on creation form
> class myForm(forms.Form):
> test = forms.CharField(label = _('test'), max_length=255, required =
> True)
>
> myForm(initial = {'test': 'test string'}).
>
> If you use form that generated
3 matches
Mail list logo