823 B
823 B
relations.utils
get_relations_sides_and_names
get_relations_sides_and_names(to_field: Type[BaseField], parent: "Model", child: "Model", child_name: str, virtual: bool, relation_name: str) -> Tuple["Model", "Model", str, str]
Determines the names of child and parent relations names, as well as changes one of the sides of the relation into weakref.proxy to model.
Arguments:
to_field (BaseField): field with relation definitionparent (Model): parent modelchild (Model): child modelchild_name (str): name of the childvirtual (bool): flag if relation is virtualrelation_name ():
Returns:
(Tuple["Model", "Model", str, str]): parent, child, child_name, to_name