Changes between Initial Version and Version 4 of Ticket #30076


Ignore:
Timestamp:
Jan 4, 2019, 2:19:12 PM (6 years ago)
Author:
Joshua Cannon
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30076

    • Property Owner changed from nobody to Joshua Cannon
    • Property Triage Stage UnreviewedAccepted
    • Property Has patch set
  • Ticket #30076 – Description

    initial v4  
    11Since `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.
    22
    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 falsey, the method never gets added.
     3Usually 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.
    44
    55So far I've seen 2 libraries that have this "issue", which is likely a small set.
Back to Top