﻿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
32460	TextChoices/IntegerChoices can not have a member with name `label`	elonzh	Nick Pope	"
{{{
import enum
from django.db.models import TextChoices, IntegerChoices


class A(enum.Enum):
    label = ""label""


print(""case A, builtin Enum type:"", A.label)


class B(TextChoices):
    LABEL = ""label""


print(""case B, TextChoices with a choice `LABEL`:"", B.LABEL)

try:
    class C(TextChoices):
        label = ""label""

except Exception as e:
    print(""case C, TextChoices with a choice `label`:"", e)


try:
    class D(IntegerChoices):
        label = 0

except Exception as e:
    print(""case D, IntegerChoices with a choice `label`:"", e)

}}}


output:


{{{
case A, builtin Enum type: A.label
case B, TextChoices with a choice `LABEL`: label
case C, TextChoices with a choice `label`: Cannot reassign members.
case D, IntegerChoices with a choice `label`: Cannot reassign members.
}}}
"	Bug	closed	Database layer (models, ORM)	3.0	Normal	fixed	Choices		Ready for checkin	1	0	0	0	0	0
