API Documentation

Models

class abstract_relations.models.AbstractManyToManyField(to, **kwargs)[source]

Bases: django.db.models.fields.related.ManyToManyField

_get_through_model(abstract_through, from_model, to_model)[source]

Returns the newly generated intermediary model.

Returns:
models.Model: Dynamically created intermediary model
_recreate_through_model(cls)[source]

Overwrites the through attribute with new intermediary model.

Makes the class available in same module, where the original intermediary model was defined.

contribute_to_class(cls, name, **kwargs)[source]

If the field has been defined inside non-abstract class, tries to dynamically create a new intermediary model.