Skip to content

Model Field in type annotation runtime error #61

Description

@cs-cordero

Originally posted on the gitter:

I'm coming across this issue where I'm trying to use a Field in a type annotation something like: Dict[Field, Any]

If i use mypy on this with django-stubs enabled, i get this error message:

`Missing type parameters for generic type`

so then i change it to Dict[Field[Any, Any], Any], and that fixes the problem in mypy, but at runtime, it fails:

`TypeError: 'type' object is not subscriptable`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions