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.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 088bd43c12371d68dd513ddec4e6e3b1a0f66eedad2861fef93cd050cdb3125e |
|
MD5 | 85522811b0161229c72ee253117be427 |
|
BLAKE2b-256 | 63080865c713606d2d8255fb679e4796e4bbde555f58a485cb882f4049f599ee |
Close
Hashes for django_enumchoicefield-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7d4b1c48f8c86981afac146b3a7840dae21333fb318841a2d558ed65b51fa6a |
|
MD5 | 4f3af4870577405a25f47b5daf1b6164 |
|
BLAKE2b-256 | fb4e87cfbda3a8711d6388f6365f19bd44989c26c9073c72e362ef445a94e36b |