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-0.9.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1db7d3b6d1b89ec007ed264aeb0ee658e14b80d0fa8392900c90021ae058cc1f |
|
MD5 | 4e13b68a06bdf8389b42ee5d6271ade1 |
|
BLAKE2b-256 | 4dd0c06fee93e7156e3893002c132cd19ce76e2351776ead52a5e158f1de57f5 |
Close
Hashes for django_enumchoicefield-0.9.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae1ec746565403e352f9725f61ad459924dd5e6dbce2ec53ada860952b1c4d70 |
|
MD5 | 4882337ba437d588fb790a3191a51c81 |
|
BLAKE2b-256 | 8391f691918f1abd848f3b2902e98784b295c4be957681fc3c4d4870e2e03740 |