Changes between Initial Version and Version 4 of Ticket #30076
- Timestamp:
- Jan 4, 2019, 2:19:12 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30076
- Property Owner changed from to
- Property Triage Stage Unreviewed → Accepted
- Property Has patch set
-
Ticket #30076 – Description
initial v4 1 1 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. 2 2 3 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 fals ey, the method never gets added.3 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. 4 4 5 5 So far I've seen 2 libraries that have this "issue", which is likely a small set.