Login

Snippets by chasfs

Snippet List

Subclassing a model.field for newforms

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. e.g. age = MMIntegerField('How old are you?', min_value=13, max_value=120)

  • newforms
  • fields
  • model
Read More

chasfs has posted 1 snippet.