Skip to main content
Help us improve Python packaging – donate today!

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)

Testing

To run the tests:

$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements-dev.txt
$ tox

Release history Release notifications

This version
History Node

1.0.0

History Node

0.9.0

History Node

0.8.0

History Node

0.7.0

History Node

0.6.0

History Node

0.5.2

History Node

0.5.0

History Node

0.4.0

History Node

0.3.0

History Node

0.2.0

History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_enumchoicefield-1.0.0-py2.py3-none-any.whl (14.7 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Jan 31, 2018
django-enumchoicefield-1.0.0.tar.gz (9.5 kB) Copy SHA256 hash SHA256 Source None Jan 31, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page