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.8.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 683ef9dd49218d424e34de0c5be5e6f45caed9e7a23aeb5a061215d05f0542fe |
|
MD5 | 818a733871a3ce35a2ce047bdca7c2b6 |
|
BLAKE2b-256 | d9097da15ba792a94244d2f8c8fb64480c442f19087b37ccb358540fa4e8d9f2 |
Close
Hashes for django_enumchoicefield-0.8.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c01932a4966f1dc4c4f8d973248fdc55e1c710fab0c7e42925a5b21dbfab0a83 |
|
MD5 | 442f16251f2deb55807dc8a9690da791 |
|
BLAKE2b-256 | fed849e11a6e1e1217f4558c172ae27e47468a5f52dd410dd00e539ac4a1fe2e |