Skip to main content

An IntEnumField for Django

Project description

Django IntEnumField

Build Status

An IntEnumField for Django.

Features

  • Store your multiple-choice options as a smallint (2 bytes) instead of varchar
  • Reuse existing IntEnums as choice values
  • Integrates well with Django's admin app (display and filter)

Requirements

  • Python 3.8+
  • Django 2.2+

Usage

from enum import IntEnum
from django.db import models
from django_intenum import IntEnumField


class Status(IntEnum):
	UNKNOWN = 0
	IN_PROGRESS = 1
	COMPLETED = 2
	ERROR = 3


class Job(models.Model):
	status = IntEnumField(enum=Status)

License

This project is licensed under the MIT license. The full license text is available in the LICENSE file.

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_intenumfield-2.0.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_intenumfield-2.0.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file django_intenumfield-2.0.0.tar.gz.

File metadata

  • Download URL: django_intenumfield-2.0.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for django_intenumfield-2.0.0.tar.gz
Algorithm Hash digest
SHA256 c6918100be3411c1d5f1dcc4c3d126149f45ab015d1352bbe9c1cb677673198c
MD5 caf366564ddfe2f15743a3fadcaaf24c
BLAKE2b-256 d308eb071f06a4b419b952baffd231d14e0e667b5954bc0a87c768d877ca4ba0

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_intenumfield-2.0.0.tar.gz:

Publisher: ci.yml on HearthSim/django-intenumfield

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_intenumfield-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_intenumfield-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fdb4fb9852d5a3e8862668d68a5452177d6dd15e1529505481c7569f9984121
MD5 a869c5ba925e18f328e2d49461bcef6e
BLAKE2b-256 efcd5275510dff175572eada314e4f2af3cb86d0d1ddb74f5aab28ba785e7196

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_intenumfield-2.0.0-py3-none-any.whl:

Publisher: ci.yml on HearthSim/django-intenumfield

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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