add enum field (#626)

* add enum field

* add decorator for asyncio

* fix enum typing, additional tests, add docs

* add more tests

Co-authored-by: collerek <collerek@gmail.com>
This commit is contained in:
Ethon
2022-04-27 18:01:00 +08:00
committed by GitHub
parent 2caa17812a
commit ebf7c6e06f
10 changed files with 193 additions and 17 deletions

View File

@ -637,10 +637,11 @@ Available Model Fields (with required args - optional ones in docs):
* `Decimal(scale, precision)`
* `UUID()`
* `LargeBinary(max_length)`
* `EnumField` - by passing `choices` to any other Field type
* `Enum(enum_class)`
* `Enum` like Field - by passing `choices` to any other Field type
* `EncryptedString` - by passing `encrypt_secret` and `encrypt_backend`
* `ForeignKey(to)`
* `ManyToMany(to, through)`
* `ManyToMany(to)`
### Available fields options
The following keyword arguments are supported on all field types.