utils
get_relations_sides_and_names(to_field, parent, child)
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.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
to_field |
ForeignKeyField
|
field with relation definition |
required |
parent |
Model
|
parent model |
required |
child |
Model
|
child model |
required |
Returns:
Type | Description |
---|---|
Tuple["Model", "Model", str, str]
|
parent, child, child_name, to_name |
Source code in ormar\relations\utils.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|