On Apr 1, 1:51 pm, Nick Arnett wrote:
> On Thu, Apr 1, 2010 at 10:34 AM, Chris Curvey wrote:
>
> > class FoobarForm(ModelForm):
> > foo = forms.FloatField(label = '$')
> > id = forms.HiddenField()
>
> If you're using newforms, there's no such thing as HiddenField.
>
> Perhaps you want this:
>
On Thu, Apr 1, 2010 at 10:34 AM, Chris Curvey wrote:
>
> class FoobarForm(ModelForm):
> foo = forms.FloatField(label = '$')
> id = forms.HiddenField()
If you're using newforms, there's no such thing as HiddenField.
Perhaps you want this:
id = forms.IntegerField(widget = forms.HiddenInput)
this has got to be FAQ, but I can't find it for the life of me.
I have an ordinary Django model class, which has been automatically
been given a field called "id". Great. Now I want to use this field
as a hidden value in a ModelForm, but whenever I add "id" to the list
of fields in the form, I g
3 matches
Mail list logo