#32460: TextChoices/IntegerChoices can not have a member with name `label`
-------------------------------------+-------------------------------------
Reporter: elonzh | Owner: starryrbs
Type: Bug | Status: assigned
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: Choices | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by starryrbs):
* owner: nobody => starryrbs
* status: new => assigned
Comment:
I checked the source code of django, in django.db.models.enums path:
{{{
cls.label = property(lambda self: cls._value2label_map_.get(self.value))
cls.do_not_call_in_templates = True
}}}
{{{label}}} and {{{do_not_call_in_templates}}} cannot be used as enum
keys.
We may need to add this to the Django document or change the label to
configurable.
I submitted a pull request to support this feature.
[https://github.com/django/django/pull/14020]
--
Ticket URL: <https://code.djangoproject.com/ticket/32460#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.5750f0813f3352882efb58b6349964aa%40djangoproject.com.