django-enums

This package provides a backport of the Enumeration Types for Django model field types from Django 3.0 to Django 2.x.

Installation

Install directly from GitHub:

pip install git+https://github.com/cedadev/django-enums.git

Add the django_enums app to INSTALLED_APPS in your settings.py:

INSTALLED_APPS = [
    # Other apps
    'django_enums',
    # Other apps
]

Usage

Use is as described in the Django 3.0 documentation, except that Choices, TextChoices and IntegerChoices are imported from django_enum.