Skip to content

model.Meta is unrecognized in the latest version #279

Open
@tylerlaprade

Description

@tylerlaprade

I did not have this problem in 0.19.1. After upgrading to 0.20.0, the below code errors on model.Meta

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from django.db.models import Model

def foo(model: type['Model']):
    model.Meta    # Cannot access attribute "Meta" for class "type[Model]". Attribute "Meta" is unknownPylance[reportAttributeAccessIssue]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions