Skip to main content

django-enums

django-enums is a simple Enum class and EnumField for Django models. Enum class inherits Enum class in the default enum module. EnumFiled class inherits Charfield.

Installation

>>> pip install django-enums

Usage

Inherit Enum class and set it to EnumField.enum.:

from django.db import models
from django_enums import enum

class MyEnum(enum.Enum):

    __order__ = 'FOO BAR FOOBAR' # for python 2

    FOO = ('f', 'Foo')
    BAR = ('b', 'Bar')
    FOOBAR = ('fb', 'FooBar')


class MyModel(models.Model):

    enum_field = enum.EnumField(
        MyEnum, # required
        default=MyEnum.FOO, # optional
        )

Metadata

Release files for django-enums 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-enums 0.1.9
File Size Uploaded Provenance
django-enums-0.1.9.linux-x86_64.tar.gz 12.3 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for django-enums 0.1.9
File Interpreter ABI Platform
django_enums-0.1.9-py2.7.egg Legacy Egg format - - Details
django_enums-0.1.9-py2-none-any.whl Python 2 none any Details

Total release size: 54.0 kB

Release files / django-enums-0.1.9.linux-x86_64.tar.gz

Download URL django-enums-0.1.9.linux-x86_64.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3a0246ce2b5ee3620d0989fd2701e2a6efc7299e97994c1858b5ddb02283c2bd
BLAKE2b-256 checksum
How to use checksums
285bfcb0da3a68e13544951cb62b71ea586c1aa35c6358db78ef9c74ef08fef7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_enums-0.1.9-py2.7.egg

Download URL django_enums-0.1.9-py2.7.egg
Size 23.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
c1a9ffae4e720ea340d5e84fc4b5e369fe49d58a7557b68157b1d9d834e6d052
BLAKE2b-256 checksum
How to use checksums
37c3b0c2f4beea5a8c995d2835bb78d9ce64d3e64f5657da4427cf6be9d0e5e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_enums-0.1.9-py2-none-any.whl

Download URL django_enums-0.1.9-py2-none-any.whl
Size 18.7 kB
Tags Python 2
SHA-256 checksum
How to use checksums
d74cbbeb88f200de3e16e38715a8ebbc37b44bc7909c30b52bf22626525a5c22
BLAKE2b-256 checksum
How to use checksums
a205186f52115c55797e0601b97c957ab6b62710a587d0721588ef99a8761548
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-enums 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page