A choice field for Django using native Python Enums
Project description
A Django model field for native Python 3.4 Enums.
from enumchoicefield import ChoiceEnum, EnumChoiceField
class Fruit(ChoiceEnum):
apple = "Apple"
banana = "Banana"
orange = "Orange"
class Profile(models.Model):
name = models.CharField(max_length=100)
favourite_fruit = EnumChoiceField(Fruit, default=Fruit.banana)
Documentation
Testing
To run the tests:
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements-dev.txt
$ tox
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
Built Distribution
Close
Hashes for django-enumchoicefield-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9b55c9cf3e94dc2bcfe778456bb71cc6a908aa1dab6c2742335afa75764eeb7 |
|
MD5 | 1867a6fe2743c8737588fd663a62c4ff |
|
BLAKE2b-256 | f95d3d487021d7e4b854a8c62ff7f6565dc9e7e878a438f67328b82ce793a7db |
Close
Hashes for django_enumchoicefield-2.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dc7d9ea2ac1fd7749262a310708d890442ac3ffdf2a65918559262570e76d07 |
|
MD5 | ba7c83f06e7561beea8095166bf868f6 |
|
BLAKE2b-256 | 6f9293200398ca36aafeb6a9aa2e3d113e2b72ed530157dd9edb459ee5061b86 |