skillfed

django-extended-choices

Little helper application to improve django choices (for fields)

django-extended-choices v1.3.3 91.6K downloads/30d#13,513 on PyPI83
Permissive license BSD Abandoned released

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-choices

uv

uv add django-extended-choices

poetry

poetry add django-extended-choices

Installing 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

Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 1.10Framework :: Django :: 1.11Framework :: Django :: 1.8Framework :: Django :: 1.9Framework :: Django :: 2.0Framework :: Django :: 2.1Framework :: Django :: 2.2Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

django choices helperdjango field choicesdjango constants managementdjango choice declarationsreadable django choicesdjango choice lookupdjango choice subsets
django-utilitychoice-management

More Libraries packages

urllib3

urllib3 is an HTTP client library that provides…

permissive · top 100 on PyPI

requests

Requests is a Python HTTP library that…

permissive · top 100 on PyPI

pluggy

Pluggy provides a plugin system that lets you…

permissive · top 100 on PyPI

python-dateutil

Provides parsing, arithmetic, and recurrence…

permissive · top 100 on PyPI

six

Six provides utility functions to write Python…

permissive · top 100 on PyPI

pytest

pytest is a testing framework that lets you…

permissive · top 100 on PyPI

django-autocomplete-light

Provides autocomplete widgets for Django forms…

permissive · top 15,000 on PyPI

django-enumfields

Provides Django model fields that store Python…

permissive · top 15,000 on PyPI

django-ordered-model

Adds ordering and reordering capabilities to…

permissive · top 15,000 on PyPI

django-multiselectfield

Adds model and form fields to Django that let…

copyleft · top 5,000 on PyPI

django-add-default-value

Provides a Django migration operation to set…

permissive · top 15,000 on PyPI

drf-writable-nested

Extends Django REST Framework serializers to…

permissive · top 15,000 on PyPI

django-nested-inline

Enables nested inline editing in Django admin,…

permissive · top 15,000 on PyPI

django-pgviews-redux

Adds first-class PostgreSQL view support to…

unclear · top 15,000 on PyPI

django-lifecycle

Adds declarative lifecycle hooks to Django…

permissive · top 15,000 on PyPI

django-eveuniverse

Provides Django models for Eve Online universe…

unclear · top 15,000 on PyPI