﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30076	get_FOO_display missing if field choices is specified but falsey	Joshua Cannon	Joshua Cannon	"Since `Field` checks if `choices` is truthy [https://github.com/django/django/blob/master/django/db/models/fields/__init__.py#L745 code] instead of checking against `None`, some model instances aren't receiving the `get_FOO_display` method.

Usually the culprit is `Field` subclasses doing some kind of dynamic choice generation, providing `choices=()` as a sort of fallback. Since `()` is an empty tuple that is falsy, the method never gets added.

So far I've seen 2 libraries that have this ""issue"", which is likely a small set.
   - [https://github.com/jazzband/django-model-utils/blob/master/model_utils/fields.py#L75 django-model-utils] just gives some dummy choices.
   - [https://github.com/craigds/django-typed-models/issues/47 django-typed-models] doesn't have a fix yet."	Bug	closed	Database layer (models, ORM)	2.1	Normal	fixed	choices get_FOO_display		Accepted	1	0	0	0	1	0
