Re: Accessing model field validators from within form template

2010-08-20 Thread omat
Please see below. > Why do you use MaxLengthValidator instead of max_length property? max_length does not work for models.TextField > What are you using those values for? Couldn't it be a possibility to > use help_text attribute? It won't be DRY to repeat the value both as a parameter to the

Re: Accessing model field validators from within form template

2010-08-18 Thread skyjur
Why do you use MaxLengthValidator instead of max_length property? What are you using those values for? Couldn't it be a possibility to use help_text attribute? On Aug 18, 3:41 pm, omat wrote: > Hi, > > In my generic form template, if a CharField has a max_length > attribute, I

Accessing model field validators from within form template

2010-08-18 Thread omat
Hi, In my generic form template, if a CharField has a max_length attribute, I display that beside the form field: {% if field.field.max_length %} Max. {{ field.field.max_length }} char. {% endif %} I want to do the same for TextFields, where max_length is not used, but the max limit is set