module documentation

Helper functions for mapping model fields to a dictionary of default keyword arguments that should be used for their equivalent serializer fields.

Class ClassLookupDict Takes a dictionary with classes as keys. Lookups against this object will traverses the object's inheritance hierarchy in method resolution order, and returns the first matching value from the dictionary or raises a KeyError if nothing matches.
Function get_detail_view_name Given a model class, return the view name to use for URL relationships that refer to instances of the model.
Function get_field_kwargs Creates a default instance of a basic non-relational field.
Function get_nested_relation_kwargs Undocumented
Function get_relation_kwargs Creates a default instance of a flat relational field.
Function get_unique_error_message Undocumented
Function get_url_kwargs Undocumented
Function needs_label Returns `True` if the label based on the model's verbose name is not equal to the default label it would have based on it's field name.
Constant NUMERIC_FIELD_TYPES Undocumented
def get_detail_view_name(model): (source)

Given a model class, return the view name to use for URL relationships that refer to instances of the model.

def get_field_kwargs(field_name, model_field): (source)

Creates a default instance of a basic non-relational field.

def get_nested_relation_kwargs(relation_info): (source)

Undocumented

def get_relation_kwargs(field_name, relation_info): (source)

Creates a default instance of a flat relational field.

def get_unique_error_message(model_field): (source)

Undocumented

def get_url_kwargs(model_field): (source)

Undocumented

def needs_label(model_field, field_name): (source)

Returns `True` if the label based on the model's verbose name is not equal to the default label it would have based on it's field name.

NUMERIC_FIELD_TYPES = (source)

Undocumented

Value
(models.IntegerField,
 models.FloatField,
 models.DecimalField,
 models.DurationField)