-`max_length` - Validates that the input contains no more than this number of characters.
-`max_length` - Validates that the input contains no more than this number of characters.
-`min_length` - Validates that the input contains no fewer than this number of characters.
-`min_length` - Validates that the input contains no fewer than this number of characters.
-`allow_blank` - If set to `True` then the empty string should be considered a valid value. If set to `False` then the empty string is considered invalid and will raise a validation error. Defaults to `False`.
-`allow_blank` - If set to `True` then the empty string should be considered a valid value. If set to `False` then the empty string is considered invalid and will raise a validation error. Defaults to `False`.
-`trim_whitespace` - If set to `True` then leading and trailing whitespace is trimmed. Defaults to `True`.
The `allow_null` option is also available for string fields, although its usage is discouraged in favor of `allow_blank`. It is valid to set both `allow_blank=True` and `allow_null=True`, but doing so means that there will be two differing types of empty value permissible for string representations, which can lead to data inconsistencies and subtle application bugs.
The `allow_null` option is also available for string fields, although its usage is discouraged in favor of `allow_blank`. It is valid to set both `allow_blank=True` and `allow_null=True`, but doing so means that there will be two differing types of empty value permissible for string representations, which can lead to data inconsistencies and subtle application bugs.
...
@@ -524,7 +525,7 @@ As an example, let's create a field that can be used represent the class name of
...
@@ -524,7 +525,7 @@ As an example, let's create a field that can be used represent the class name of
# We pass the object instance onto `to_representation`,
# We pass the object instance onto `to_representation`,