一个基于 Django 3.0 Choices 枚举类型的独立包
Project description
django-enum-ex
一个基于 Django 3.0 Choices 枚举类型的独立扩展包
本库基于 Django 3.0 中自带的 django.db.models.enum
特色
- 支持将枚举字段名自设置为值. 设置值为
enum.auto()
- 支持将单一值即设置为值,又设置为
label
, 通过设置类属性__value_as_label__ = True
- 增加
Choices.of
方法,在将原始值转成枚举值时,支持忽略大小定. 支持没有匹配枚举值时,抛出错误.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-enum-ex-0.1.1.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for django_enum_ex-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5b18cd960ae2bfa37762b30b495c5a77b57a8aa12e99d2051d4d9ac93778df1 |
|
MD5 | b824ea9c5bd7fc3c0e47891e76d0d465 |
|
BLAKE2b-256 | c14d4cd250b9c9adc757a09f298089a61e4264dfe8b4edc0816a165ae4103fc3 |