--- id: django-extended-choices version: "1.3.3" license: BSD license_treatment: permissive maintenance: abandoned --- # django-extended-choices — Little helper application to improve django choices (for fields) License: permissive · Maintenance: abandoned · Downloads: 91.6K/mo ## 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 above — 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 pip install django-extended-choices uv add django-extended-choices 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_current - Install friction: low - Maintenance: abandoned - Downloads: 91.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django choices helper, django field choices, django constants management, django choice declarations, readable django choices, django choice lookup, django choice subsets, django-utility, choice-management [View on SkillFed](https://skillfed.io/packages/django-extended-choices) · [View on PyPI](https://pypi.org/project/django-extended-choices/)