add:SmallInteger()

This commit is contained in:
xiechen
2021-08-06 11:43:51 +08:00
parent 6ffc318fd0
commit 7baaee63ce
10 changed files with 98 additions and 49 deletions

View File

@ -347,6 +347,34 @@ Accepts required and optional parameters that each column type accepts.
`sqlalchemy Column`: initialized column with proper options
<a name="fields.model_fields.SmallInteger"></a>
## SmallInteger Objects
```python
class SmallInteger(Integer, int)
```
SmallInteger field factory that construct Field classes and populated their values.
<a name="fields.model_fields.SmallInteger.get_column_type"></a>
#### get\_column\_type
```python
| @classmethod
| get_column_type(cls, **kwargs: Any) -> Any
```
Return proper type of db column for given field type.
Accepts required and optional parameters that each column type accepts.
**Arguments**:
- `kwargs` (`Any`): key, value pairs of sqlalchemy options
**Returns**:
`sqlalchemy Column`: initialized column with proper options
<a name="fields.model_fields.Decimal"></a>
## Decimal Objects

View File

@ -69,6 +69,19 @@ Each of the `Fields` has assigned both `sqlalchemy` column class and python type
!!!tip
For explanation of other parameters check [pydantic][pydantic] documentation.
### SmallInteger
`SmallInteger(minimum: int = None,
maximum: int = None,
multiple_of: int = None)` has no required parameters.
* Sqlalchemy column: `sqlalchemy.SmallInteger`
* Type (used for pydantic): `int`
!!!tip
For explanation of other parameters check [pydantic][pydantic] documentation.
### Float
`Float(minimum: float = None,

View File

@ -636,6 +636,7 @@ Available Model Fields (with required args - optional ones in docs):
* `DateTime()`
* `JSON()`
* `BigInteger()`
* `SmallInteger()`
* `Decimal(scale, precision)`
* `UUID()`
* `LargeBinary(max_length)`