forms.CharField

class CharField(**kwargs) [source]

  • Default widget: TextInput
  • Empty value: '' (an empty string)
  • Normalizes to: A Unicode object.
  • Validates max_length or min_length, if they are provided. Otherwise, all inputs are valid.
  • Error message keys: required, max_length, min_length

Has three optional arguments for validation:

max_length
min_length

If provided, these arguments ensure that the string is at most or at least the given length.

strip
New in Django 1.9.

If True (default), the value will be stripped of leading and trailing whitespace.

doc_Django
2016-10-09 18:36:39
Comments
Leave a Comment

Please login to continue.