Skip to main content

Simple enum for Django choice fields

Project description

This app includes DjangoEnum class which compatible with Django choice fields.

Usage example:

from django.db import models
from django_enum import DjangoEnum


class StatusTypes(DjangoEnum):
    ACTIVE = 0
    STOPPING = 1
    STOPPED = 2


class MyModel(models.Model):
    status = models.IntegerField(choices=StatusTypes.choices())

CHANGELOG:

1.0.1: Fix name, value issue

Project details


Download files

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

Source Distribution

django-enum-simple-choices-1.0.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-enum-simple-choices-1.0.1.tar.gz.

File metadata

File hashes

Hashes for django-enum-simple-choices-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c55bf54b632f2179c51a684e2b0dc26fb6cc8ddc2670876f8309e1543a55c83e
MD5 b77718d8b00f1f638b9caac2182a8dab
BLAKE2b-256 175f56d7eb3291e83ef14e78576d7095feb8b038b8e4d218271c44ac80862c32

See more details on using hashes here.

File details

Details for the file django_enum_simple_choices-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_enum_simple_choices-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc1f469cb587967f1ca57d72e2956ff54f807556c0efcda9c5f7eb3de19b9adb
MD5 2c4ad462c0f603fa1452a8ab515e1ddf
BLAKE2b-256 55cd3796e0651e3de859f7081975d4d6468c83a34324a977abe07bea03faec35

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page