Re: Remove a field from a form

2007-07-09 Thread ilDave
I read this on the documentation, but I'm usinge the 0.96 versione, non the development one, so I can't use it... But Nathan's method worls well :) On Jul 9, 1:04 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 7/9/07, ilDave <[EMAIL PROTECTED]> wrote: > > > > > Hi! > > I have to show

Re: Remove a field from a form

2007-07-09 Thread Russell Keith-Magee
On 7/9/07, ilDave <[EMAIL PROTECTED]> wrote: > > Hi! > I have to show two identical forms in a page, so I used form_for_model > and I created two form objects. ... > What am I missing? Try form_for_model(MyModel, fields=('field1','field2')). That will generate a form for MyModel that only contain

Re: Remove a field from a form

2007-07-09 Thread ilDave
I have to remove the field from the object class and not from the class instance... Thanks! On Jul 9, 12:52 pm, Nathan Ostgard <[EMAIL PROTECTED]> wrote: > Do this instead: > > PreventivoForm = form_for_model(Preventivo) > del PreventivoForm.base_fields['codice'] > f = PreventivoForm() > f2 = Pr

Re: Remove a field from a form

2007-07-09 Thread Nathan Ostgard
Do this instead: PreventivoForm = form_for_model(Preventivo) del PreventivoForm.base_fields['codice'] f = PreventivoForm() f2 = PreventivoForm(auto_id='id_%s2') Nathan Ostgard On Jul 9, 2:33 am, ilDave <[EMAIL PROTECTED]> wrote: > Hi! > I have to show two identical forms in a page, so I us

Remove a field from a form

2007-07-09 Thread ilDave
Hi! I have to show two identical forms in a page, so I used form_for_model and I created two form objects. I don't need to show a particular field, so i tried to remove it this way: def showtwoforms(request): PreventivoForm = form_for_model(Preventivo) #'Preventivo' is the model f = Prev