update docs, add load_all(), tests for load_all, make through field optional
This commit is contained in:
@ -23,7 +23,7 @@ aliases for proper sql joins.
|
||||
#### register\_many\_to\_many\_relation\_on\_build
|
||||
|
||||
```python
|
||||
register_many_to_many_relation_on_build(field: Type[ManyToManyField]) -> None
|
||||
register_many_to_many_relation_on_build(field: Type["ManyToManyField"]) -> None
|
||||
```
|
||||
|
||||
Registers connection between through model and both sides of the m2m relation.
|
||||
@ -89,11 +89,24 @@ Autogenerated reverse fields also set related_name to the original field name.
|
||||
|
||||
- `model_field (relation Field)`: original relation ForeignKey field
|
||||
|
||||
<a name="models.helpers.relations.register_through_shortcut_fields"></a>
|
||||
#### register\_through\_shortcut\_fields
|
||||
|
||||
```python
|
||||
register_through_shortcut_fields(model_field: Type["ManyToManyField"]) -> None
|
||||
```
|
||||
|
||||
Registers m2m relation through shortcut on both ends of the relation.
|
||||
|
||||
**Arguments**:
|
||||
|
||||
- `model_field (ManyToManyField)`: relation field defined in parent model
|
||||
|
||||
<a name="models.helpers.relations.register_relation_in_alias_manager"></a>
|
||||
#### register\_relation\_in\_alias\_manager
|
||||
|
||||
```python
|
||||
register_relation_in_alias_manager(field: Type[ForeignKeyField]) -> None
|
||||
register_relation_in_alias_manager(field: Type["ForeignKeyField"]) -> None
|
||||
```
|
||||
|
||||
Registers the relation (and reverse relation) in alias manager.
|
||||
|
||||
Reference in New Issue
Block a user