Re: using "id" as a field name in ModelForm.

2010-04-01 Thread Chris Curvey
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: >

Re: using "id" as a field name in ModelForm.

2010-04-01 Thread Nick Arnett
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)

using "id" as a field name in ModelForm.

2010-04-01 Thread Chris Curvey
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