In django 1.1, how do I find a form field's max_length attribute

Posted by AlexH on Stack Overflow See other posts from Stack Overflow or by AlexH
Published on 2010-03-14T15:39:39Z Indexed on 2010/03/14 15:45 UTC
Read the original article Hit count: 183

Filed under:
|

I have a form that looks like this:

class SampleForm(forms.Form):
    text = forms.CharField(max_length=100)

In my django template, I want to reference the fact that the length is 100.

I tried {{ form.text.max_length }} to no avail.

On a related note, how do I reference this value in python?

© Stack Overflow or respective owner

Related posts about django-forms

Related posts about django