{"id":44750,"library":"django-extended-choices","title":"django-extended-choices","description":"A Django helper to define choices for model fields in a more readable and maintainable way, with support for grouping, named constants, and easy iteration. Current version 1.3.3, maintenance mode with occasional bug fixes.","status":"maintenance","version":"1.3.3","language":"python","source_language":"en","source_url":"https://github.com/twidi/django-extended-choices","tags":["django","choices","enum"],"install":[{"cmd":"pip install django-extended-choices","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Required integration with Django models and fields","package":"django","optional":false}],"imports":[{"wrong":"from django_extended_choices.choices import Choices","symbol":"Choices","correct":"from extended_choices import Choices"}],"quickstart":{"code":"from django.db import models\nfrom django_extended_choices.choices import Choices\n\nclass Pizza(models.Model):\n    CRUST_THIN = 'thin'\n    CRUST_THICK = 'thick'\n    ORGANIC = 'organic'\n    \n    CRUSTS = Choices(\n        ('STANDARD', 'Standard', 'Standard crust'),\n        ('THIN', 'Thin', 'Thin crust'),\n        ('THICK', 'Thick', 'Thick crust'),\n    )\n    \n    crust = models.CharField(max_length=10, choices=CRUSTS)\n    custom_choice = models.CharField(max_length=20, choices=Choices('A', 'B'))","lang":"python","description":"Define choices using tuples with constant name, value, and display label, then use in model field."},"warnings":[{"fix":"Update your requirements to django-extended-choices>=1.0.0 and ensure imports use 'django_extended_choices'.","message":"In version 1.0, the package renamed from django_extended_choices to django-extended-choices on PyPI, and imports changed. Old 'django_extended_choices' imports still work with the new package? Actually, the package name changed on PyPI but the module remains django_extended_choices. Check your requirements.","severity":"breaking","affected_versions":"<1.0"},{"fix":"Replace NamedValuesChoices with Choices.","message":"NamedValuesChoices deprecation: In version 1.3, NamedValuesChoices is deprecated and may be removed. Use Choices instead which covers all use cases.","severity":"gotcha","affected_versions":">=1.3,<2.0"},{"fix":"Prefix your model constants or use different names to avoid confusion.","message":"If you define a constant with the same name as a choice constant (e.g., CRUST_THIN), the order of definition matters: the constant is overridden by the choice when iterating? Actually, constants defined before Choices are preserved. Be careful with naming clashes.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.3.3':32 'bug':37 'choic':4,10,40 'constant':26 'current':30 'defin':9 'django':2,6,39 'django-extended-choic':1 'easi':28 'enum':41 'extend':3 'field':13 'fix':38 'group':24 'helper':7 'iter':29 'maintain':19 'mainten':33 'mode':34 'model':12 'name':25 'occasion':36 'readabl':17 'support':22 'version':31 'way':20","created_at":"2026-06-07T12:51:38.965723+00:00","updated_at":"2026-06-07T12:51:38.965723+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpm_l31qt1/venv/lib/python3.12/site-packages/extended_choices/__init__.py\", line 3, in <module>\n    import pkg_resources\nModuleNotFoundError: No module named 'pkg_resources'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/twidi/django-extended-choices","github":"https://github.com/twidi/django-extended-choices","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}