Re: DRY: max length not taken from Model.field when using ModelForm

2009-11-09 Thread fest
Tomasz, it was obvious for me too, however, I had defined a form, which had some fields overridden, but some not- I was hoping that options for fields that were not overridden were preserved, but due to specific way admin interface handles forms, required class wasn't added to my custom form field

Re: DRY: max length not taken from Model.field when using ModelForm

2009-11-07 Thread Tomasz ZieliƄski
On 7 Lis, 18:25, fest wrote: > From my experience, max_length is not taken into account when you > override model field in form field. This is (and was, when I first time faced it) quite obvious for me . If ModelForm was modifying overridden fields, the whole concept of overriding would be usele

Re: DRY: max length not taken from Model.field when using ModelForm

2009-11-07 Thread fest
>From my experience, max_length is not taken into account when you override model field in form field. In this case I don't know of any trivial way to read other field properties from model description. Regards, Reinis On 20 okt., 17:54, Karen Tracey wrote: > On Thu, Oct 15, 2009 at 12:30 PM,

Re: DRY: max length not taken from Model.field when using ModelForm

2009-10-20 Thread Karen Tracey
On Thu, Oct 15, 2009 at 12:30 PM, Gerard wrote: > > Hi All, > > It seems the max_lenght from the model definition is not respected > thoughout > the form that's created when using Modelform. > > company_name = models.CharField(max_length=75) > > Is this correct or am I missing something? > T

DRY: max length not taken from Model.field when using ModelForm

2009-10-15 Thread Gerard
Hi All, It seems the max_lenght from the model definition is not respected thoughout the form that's created when using Modelform. company_name = models.CharField(max_length=75) Is this correct or am I missing something? And while violating DRY is the Modelform definition the best place t