djangosnippets.org: Latest snippets posted by chasfshttps://djangosnippets.org/users/chasfs/2007-03-28T12:10:10.357280-05:00chasfsSubclassing a model.field for newforms
2007-03-28T12:10:10.357280-05:00chasfshttps://djangosnippets.org/snippets/138/<p>The newforms fields are more capable than the django models fields. In this snippet, we subclass models.IntegerField, and add min_value and max_value.</p>
<p>e.g.
age = MMIntegerField('How old are you?', min_value=13, max_value=120)</p>
Freely redistributable