Skip to content

Instance of 'tuple' has no 'label' member (no-member) #263

Open
@thibaut-pro

Description

@thibaut-pro

Accessing the .label member for a models.TextChoices enumeration type https://docs.djangoproject.com/en/3.0/ref/models/fields/#enumeration-types raises this pylint error: Instance of 'tuple' has no 'label' member (no-member). Is this something that would make sense to fix in pylint-django?

Repro:

class Student(models.Model):

    class YearInSchool(models.TextChoices):
        FRESHMAN = 'FR', _('Freshman')
        SOPHOMORE = 'SO', _('Sophomore')
        JUNIOR = 'JR', _('Junior')
        SENIOR = 'SR', _('Senior')
        GRADUATE = 'GR', _('Graduate')

    YearInSchool.FRESHMAN.label

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions