Skip to main content

一个基于 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 方法,在将原始值转成枚举值时,支持忽略大小定. 支持没有匹配枚举值时,抛出错误.
  • 增加 IntegerChoicesFieldTextChoicesField 两个Model Field

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-enum-ex, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size django_enum_ex-0.2.0-py3-none-any.whl (5.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size django-enum-ex-0.2.0.tar.gz (5.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page