update docs, add load_all(), tests for load_all, make through field optional

This commit is contained in:
collerek
2021-03-03 19:48:40 +01:00
parent 9ad1528cc0
commit a8ae50276e
56 changed files with 1653 additions and 653 deletions

View File

@ -332,3 +332,32 @@ Selects the appropriate constructor based on a passed value.
`(Optional[Union["Model", List["Model"]]])`: returns a Model or a list of Models
<a name="fields.foreign_key.ForeignKeyField.get_relation_name"></a>
#### get\_relation\_name
```python
| @classmethod
| get_relation_name(cls) -> str
```
Returns name of the relation, which can be a own name or through model
names for m2m models
**Returns**:
`(bool)`: result of the check
<a name="fields.foreign_key.ForeignKeyField.get_source_model"></a>
#### get\_source\_model
```python
| @classmethod
| get_source_model(cls) -> Type["Model"]
```
Returns model from which the relation comes -> either owner or through model
**Returns**:
`(Type["Model"])`: source model