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-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6df41949a774296859fbe2a55be0caf7ef08500d1a5d2e73621e4283a7204036 |
|
MD5 | 57011f42b2c58f34b4cf9d335fa662fe |
|
BLAKE2b-256 | c71ec4e4d9e9acf88020cdd1af21b7fb187f5ae51c05e72d940dc27134963797 |
Close
Hashes for django_enumchoicefield-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a94c2ceb26ea0eb4bdf35b524fbd2335d27c44a43d25e7e3518943f23b2752f0 |
|
MD5 | 25b883948de33ae34238bd3407a9d45a |
|
BLAKE2b-256 | ab683e28a5ccb79b6508d42cf15c49294ddfd787d5529c085637f308275754b5 |