django-choices-field
Django field that set/get django's new TextChoices/IntegerChoices enum.
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, supports current Django and Python versions, and solves a genuine friction point in Django development—the gap between TextChoices/IntegerChoices enums and what you actually get back from the database. Low install friction and permissive licensing make it a straightforward addition to any Django project.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- IntegerChoicesFlag requires Python 3.11 or later; base functionality requires Python 3.10+.
- Low friction install with only django and typing_extensions as runtime dependencies.
- Actively maintained with recent commits; supports Django 4.2 through 6.0 and Python 3.10 through 3.14.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you retain the license notice.
last release 2025-12-27 (230 days) · last repo commit 2026-08-10 · 17 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 99,312 downloads/mo, #13,028 on PyPI
Alternatives
Verify before relying
pip install django-choices-field
from django.db import models
from django_choices_field import TextChoicesField
class MyModel(models.Model):
class Status(models.TextChoices):
ACTIVE = "active", "Active"
INACTIVE = "inactive", "Inactive"
status = TextChoicesField(choices_enum=Status, default=Status.ACTIVE)
obj = MyModel()
assert isinstance(obj.status, MyModel.Status)
assert obj.status == "active"- Whether IntegerChoicesFlagField is available in version 4.0.0 or requires a newer release.
- Performance characteristics when storing/retrieving large numbers of enum choices.
- Compatibility with Django ORM querysets (filtering, aggregation) on enum fields.
What it is and what it does
django-choices-field bridges Django's TextChoices and IntegerChoices enums with model fields, so that when you retrieve a field value from the database, you get back the actual enum member rather than its raw string or integer value. This preserves type information and lets you use enum methods and comparisons naturally in your code.
The package provides three field types: TextChoicesField for text-based choices, IntegerChoicesField for integer-based choices, and IntegerChoicesFlagField for bitwise-combinable flags. It depends only on django and typing_extensions, making it a lightweight addition to existing Django projects. The library supports modern Django versions (4.2 through 6.0) and Python 3.10 and later.
Use it for
- Store status or state values in a model while maintaining type safety and IDE autocomplete for enum members.
- Replace raw string/integer constants in database fields with strongly-typed enum choices that can be validated at the type-checking level.
- Combine multiple flag options in a single integer field using IntegerChoicesFlagField for efficient bitwise storage.
- Simplify conditional logic by comparing model field values directly against enum members instead of string literals.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, supports current Django and Python versions, and solves a genuine friction point in Django development—the gap between TextChoices/IntegerChoices enums and what you actually get back from the database. Low install friction and permissive licensing make it a straightforward addition to any Django project.
Install
django-choices-field on PyPI
Before you install
Low friction install with only django and typing_extensions as runtime dependencies. Actively maintained with recent commits; supports Django 4.2 through 6.0 and Python 3.10 through 3.14.
IntegerChoicesFlag requires Python 3.11 or later; base functionality requires Python 3.10+.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you retain the license notice.
Quickstart
pip install django-choices-field
from django.db import models
from django_choices_field import TextChoicesField
class MyModel(models.Model):
class Status(models.TextChoices):
ACTIVE = "active", "Active"
INACTIVE = "inactive", "Inactive"
status = TextChoicesField(choices_enum=Status, default=Status.ACTIVE)
obj = MyModel()
assert isinstance(obj.status, MyModel.Status)
assert obj.status == "active"
Verify before relying
- Whether IntegerChoicesFlagField is available in version 4.0.0 or requires a newer release.
- Performance characteristics when storing/retrieving large numbers of enum choices.
- Compatibility with Django ORM querysets (filtering, aggregation) on enum fields.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesdjangotyping_extensions |
| Maintenance | Actively maintained 230 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 99,312 / month, #13,028 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: django_choices_field-4.0.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django enum field”
- django-choices-fieldProvides Django model fields that store and retrieve Django's…
- django-enumfieldsProvides Django model fields that store Python enums natively,…
- django-enumProvides a Django model field type that stores Python enumerations…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also django-enum · django-enumfields · marshmallow-enum · django-colorfield · parse-type · django-deprecate-fields · django-autocomplete-light · jsonfield · ordered-enum · django-countries