module documentation

Undocumented

Constant COMPILED​_REGEX​_TYPE Undocumented
Variable ​Field​Reference Undocumented
Class ​Regex​Object Undocumented
Function field​_is​_referenced Return whether field_tuple is referenced by any state models.
Function field​_references Return either False or a FieldReference if field references provided context.
Function get​_migration​_name​_timestamp Undocumented
Function get​_references Generator of (model_state, name, field, reference) referencing provided context.
Function resolve​_relation Turn a model class or model reference string and return a model tuple.
COMPILED_REGEX_TYPE =

Undocumented

Value
type(re.compile(r''))
FieldReference =

Undocumented

def field_is_referenced(state, model_tuple, field_tuple):
Return whether field_tuple is referenced by any state models.
def field_references(model_tuple, field, reference_model_tuple, reference_field_name=None, reference_field=None):

Return either False or a FieldReference if field references provided context.

False positives can be returned if reference_field_name is provided without reference_field because of the introspection limitation it incurs. This should not be an issue when this function is used to determine whether or not an optimization can take place.

def get_migration_name_timestamp():

Undocumented

def get_references(state, model_tuple, field_tuple=()):

Generator of (model_state, name, field, reference) referencing provided context.

If field_tuple is provided only references to this particular field of model_tuple will be generated.

def resolve_relation(model, app_label=None, model_name=None):

Turn a model class or model reference string and return a model tuple.

app_label and model_name are used to resolve the scope of recursive and unscoped model relationship.