module documentation

Undocumented

Class BooleanField Undocumented
Class CharField Undocumented
Class ChoiceField No class docstring; 0/7 instance variable, 0/1 class variable, 1/6 method documented
Class CreateOnlyDefault This class may be used to provide default values that are only used for create operations, but that do not return any value for update operations.
Class CurrentUserDefault Undocumented
Class DateField Undocumented
Class DateTimeField No class docstring; 0/3 instance variable, 0/1 class variable, 1/5 method documented
Class DecimalField No class docstring; 0/8 instance variable, 0/1 class variable, 0/1 constant, 3/6 methods documented
Class DictField No class docstring; 0/2 instance variable, 0/2 class variable, 1/5 method documented
Class DurationField Undocumented
Class EmailField Undocumented
Class empty This class is used to represent no data being provided for a given input or output value.
Class Field No class docstring; 2/3 properties, 0/17 instance variable, 0/2 class variable, 14/17 methods documented
Class FileField Undocumented
Class FilePathField Undocumented
Class FloatField Undocumented
Class HiddenField A hidden field does not take input from the user, or present any output, but it does populate a field in `validated_data`, based on its default value. This is particularly useful when we have a `unique_for_date` constraint on a pair of fields, as we need some way to include the date in the validated data.
Class HStoreField Undocumented
Class ImageField Undocumented
Class IntegerField Undocumented
Class IPAddressField Support both IPAddressField and GenericIPAddressField
Class JSONField Undocumented
Class ListField No class docstring; 0/4 instance variable, 0/2 class variable, 2/5 methods documented
Class ModelField A generic field that can be used against an arbitrary model field.
Class MultipleChoiceField Undocumented
Class ReadOnlyField A read-only field that simply returns the field value.
Class RegexField Undocumented
Class SerializerMethodField A read-only field that get its representation from calling a method on the parent serializer class. The method called will be of the form "get_{field_name}", and should take a single argument, which is the object being serialized.
Class SlugField Undocumented
Class TimeField Undocumented
Class URLField Undocumented
Class UUIDField Undocumented
Exception BuiltinSignatureError Built-in function signatures are not inspectable. This exception is raised so the serializer can raise a helpful error message.
Exception SkipField Undocumented
Function flatten_choices_dict Convert a group choices dict into a flat dict of choices.
Function get_attribute Similar to Python's built in `getattr(instance, attr)`, but takes a list of nested attributes, instead of a single attribute.
Function get_error_detail Given a Django ValidationError, return a list of ErrorDetail, with the `code` populated.
Function is_simple_callable True if the object is a callable that takes no arguments.
Function iter_options Helper function for options and option groups in templates.
Function set_value Similar to Python's built in `dictionary[key] = value`, but takes a list of nested keys instead of a single key.
Function to_choices_dict Convert choices into key/value dicts.
Constant MISSING_ERROR_MESSAGE Undocumented
Constant NOT_READ_ONLY_REQUIRED Undocumented
Constant NOT_READ_ONLY_WRITE_ONLY Undocumented
Constant NOT_REQUIRED_DEFAULT Undocumented
Constant REGEX_TYPE Undocumented
Constant USE_READONLYFIELD Undocumented
Class _UnvalidatedField Undocumented
def flatten_choices_dict(choices): (source)

Convert a group choices dict into a flat dict of choices. flatten_choices_dict({1: '1st', 2: '2nd'}) -> {1: '1st', 2: '2nd'} flatten_choices_dict({'Group': {1: '1st', 2: '2nd'}}) -> {1: '1st', 2: '2nd'}

def get_attribute(instance, attrs): (source)

Similar to Python's built in `getattr(instance, attr)`, but takes a list of nested attributes, instead of a single attribute. Also accepts either attribute lookup on objects or dictionary lookups.

def get_error_detail(exc_info): (source)

Given a Django ValidationError, return a list of ErrorDetail, with the `code` populated.

def is_simple_callable(obj): (source)

True if the object is a callable that takes no arguments.

def iter_options(grouped_choices, cutoff=None, cutoff_text=None): (source)

Helper function for options and option groups in templates.

def set_value(dictionary, keys, value): (source)

Similar to Python's built in `dictionary[key] = value`, but takes a list of nested keys instead of a single key. set_value({'a': 1}, [], {'b': 2}) -> {'a': 1, 'b': 2} set_value({'a': 1}, ['x'], 2) -> {'a': 1, 'x': 2} set_value({'a': 1}, ['x', 'y'], 2) -> {'a': 1, 'x': {'y': 2}}

def to_choices_dict(choices): (source)

Convert choices into key/value dicts. to_choices_dict([1]) -> {1: 1} to_choices_dict([(1, '1st'), (2, '2nd')]) -> {1: '1st', 2: '2nd'} to_choices_dict([('Group', ((1, '1st'), 2))]) -> {'Group': {1: '1st', 2: '2'}}

MISSING_ERROR_MESSAGE: str = (source)

Undocumented

Value
'ValidationError raised by `{class_name}`, but error key `{key}` does not exist 
in the `error_messages` dictionary.'
NOT_READ_ONLY_REQUIRED: str = (source)

Undocumented

Value
'May not set both `read_only` and `required`'
NOT_READ_ONLY_WRITE_ONLY: str = (source)

Undocumented

Value
'May not set both `read_only` and `write_only`'
NOT_REQUIRED_DEFAULT: str = (source)

Undocumented

Value
'May not set both `required` and `default`'
REGEX_TYPE = (source)

Undocumented

Value
type(re.compile(r''))
USE_READONLYFIELD: str = (source)

Undocumented

Value
'Field(read_only=True) should be ReadOnlyField'