{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/10"},{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/21"}],"enrichment":{"capability":"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.","skillfed_tags":["django-utility","choice-management"],"use_cases":["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()."],"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\u2014e.g., Choices(('ONLINE', 1, 'Online'), ('DRAFT', 2, 'Draft'))\u2014and 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().\n\nThe 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.","worth_installing":"Yes, if you are on Django 1.8\u20132.2 and Python 2.7 or 3.4\u20133.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\u2014the lack of maintenance means you will not receive compatibility updates. For legacy codebases still on supported versions, it remains stable with no known vulnerabilities."},"id":"django-extended-choices","links":{"html":"https://skillfed.io/packages/django-extended-choices","md":"https://skillfed.io/packages/django-extended-choices.md","pypi":"https://pypi.org/project/django-extended-choices/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2019-04-16","license_spdx":null,"license_treatment":"permissive","name":"django-extended-choices","python_support":"supports_current","summary":"Little helper application to improve django choices (for fields)"},"popularity":{"monthly_downloads":91551,"position":13513,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.3.3"}
