next part of the docs and api documentation in beta ver

This commit is contained in:
collerek
2021-01-04 19:38:21 +01:00
parent eec17e2f78
commit 9f8e8e87e8
64 changed files with 7414 additions and 37 deletions

View File

@ -0,0 +1,28 @@
<a name="decorators.property_field"></a>
# decorators.property\_field
<a name="decorators.property_field.property_field"></a>
#### property\_field
```python
property_field(func: Callable) -> Union[property, Callable]
```
Decorator to set a property like function on Model to be exposed
as field in dict() and fastapi response.
Although you can decorate a @property field like this and this will work,
mypy validation will complain about this.
Note that "fields" exposed like this do not go through validation.
**Raises**:
- `ModelDefinitionError`: if method has any other argument than self.
**Arguments**:
- `func (Callable)`: decorated function to be exposed
**Returns**:
`(Union[property, Callable])`: decorated function passed in func param, with set __property_field__ = True