django-extended-choices
Little helper application to improve django choices (for fields)
What it is and what it does
django-extended-choices replaces Django's verbose choice pattern (separate constants, tuples, and lookup dicts) with a single Choices object that holds the constant name, database value, and human-readable display text. You define choices once—e.g., Choices(('ONLINE', 1, 'Online'), ('DRAFT', 2, 'Draft'))—and then access them as STATES.ONLINE, pass STATES directly to model field choices, and look up entries by constant, value, or display name via methods like for_constant() and for_value().
The package also supports creating subsets of choices, ordered dicts, membership testing, and iteration. It depends only on six for Python 2/3 compatibility. The main constraint is that it is no longer maintained; the last release was in April 2019 and the repository has not received commits since December 2019.
Use it for:
- Define Django model field choices once with constants, values, and display names, then reference them throughout your code without repeating tuples.
- Look up the display text for a stored choice value in a model instance using for_value().
- Restrict a model field to a subset of choices using add_subset().
- Iterate over choices in templates or views without manually unpacking tuples or maintaining separate lookup dicts.
- Check membership and validate choice values programmatically using has_constant(), has_value(), or has_display().
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a cleaner, more readable API for defining and working with Django model field choices, replacing scattered constants and tuples with a single declarative Choices object.
Yes, if you are on Django 1.8–2.2 and Python 2.7 or 3.4–3.7. The package solves a real readability and maintainability problem in Django choice handling. However, do not use it for new projects targeting newer Django or Python versions—the lack of maintenance means you will not receive compatibility updates. For legacy codebases still on supported versions, it remains stable with no known vulnerabilities.
Install
django-extended-choices on PyPI
pip
pip install django-extended-choicesuv
uv add django-extended-choicespoetry
poetry add django-extended-choicesInstalling django-extended-choices
Before you install
Low install friction with a single lightweight dependency (six). However, the package is abandoned—last commit was 2019-12-10 and no releases since 2019-04-16. It still works with the Django versions declared, but will not receive updates for newer versions.
License in practice
BSD license (permissive) imposes no significant restrictions on use, modification, or distribution in your own projects.
Quickstart
pip install django-extended-choices
from extended_choices import Choices
STATES = Choices(
('ONLINE', 1, 'Online'),
('DRAFT', 2, 'Draft'),
('OFFLINE', 3, 'Offline'),
)
print(STATES.ONLINE)
print(STATES.for_value(1).display)
Verify before relying
- Whether the package works with Django versions released after 2.2
- Whether Python 3.8+ compatibility has been tested despite classifiers only declaring up to 3.7
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — six |
| Maintenance | abandoned — 2,677 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 91,551/month — #13,513 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_extended_choices-1.3.3-py2.py3-none-any.whl
Keywords: redis, orm, jobs, queue
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
django-autocomplete-lightProvides autocomplete widgets for Django forms…
permissive · top 15,000 on PyPI
django-enumfieldsProvides Django model fields that store Python…
permissive · top 15,000 on PyPI
django-ordered-modelAdds ordering and reordering capabilities to…
permissive · top 15,000 on PyPI
django-multiselectfieldAdds model and form fields to Django that let…
copyleft · top 5,000 on PyPI
django-add-default-valueProvides a Django migration operation to set…
permissive · top 15,000 on PyPI
drf-writable-nestedExtends Django REST Framework serializers to…
permissive · top 15,000 on PyPI
django-nested-inlineEnables nested inline editing in Django admin,…
permissive · top 15,000 on PyPI
django-pgviews-reduxAdds first-class PostgreSQL view support to…
unclear · top 15,000 on PyPI
django-lifecycleAdds declarative lifecycle hooks to Django…
permissive · top 15,000 on PyPI
django-eveuniverseProvides Django models for Eve Online universe…
unclear · top 15,000 on PyPI