Re: customizing or extending ModelForm

2008-07-06 Thread Huuuze
You added an __init__ to your ModelForm class? If so, try this: add a "fields" definition to your ModelForm's Meta class that includes this new field. You can read more about it here: http://www.djangoproject.com/documentation/modelforms/#using-a-subset-of-fields-on-the-form On Jul 6, 5:35 

Re: customizing or extending ModelForm

2008-07-06 Thread chefsmart
> > >> self.fields['short_name'] = forms.CharField(label='Short Name', > > >> max_length=9) > > > This code would need to be added to an overridden __init__ in your > > ModelForm. I tried this, however it didnn't work. It seems like the form already exists when __init__ is executed. On Jul 3,

Re: customizing or extending ModelForm

2008-07-03 Thread chefsmart
Thanks for the tip. I'm guessing this is for the newforms-admin or at least the svn trunk. I'm not adding the extra field to the model because it doesn't really belong there, though it's related to the model. On Jul 3, 6:10 pm, Huuuze <[EMAIL PROTECTED]> wrote: > Yes, you can do that, but you'd

Re: customizing or extending ModelForm

2008-07-03 Thread Huuuze
Yes, you can do that, but you'd need to add it to the ModelForm's fields: >> self.fields['short_name'] = forms.CharField(label='Short Name', max_length=9) This code would need to be added to an overridden __init__ in your ModelForm. One question, however: why don't you add this field to your

customizing or extending ModelForm

2008-07-03 Thread chefsmart
Please see the following dpaste code. http://dpaste.com/60529/ There is a model, with a ModelForm. The ModelForm has a "short_name" field that is not part of the model. Is this even possible/legal? --~--~-~--~~~---~--~~ You received this message because you are