Open syserr0r opened 10 months ago
Hmm this is tricky! I believe I used django-enum on a past project, but can't remember how we got it to work or if we stopped using it
It might make sense to create type stubs for django-enum (.pyi files) to get pyright / mypy to behave
For a model
Model
with a field such as:and code such as:
gives the following in pyright:
The VSCode IDE which also uses pyright reports the same error however when inspecting the field type it is shown as
_GT@Field
Forcing the type in the model definition as
EnumMixin
such as follows, makes no difference:I'd rather not disable type checking on all django-enum assignments if I can avoid it. Should I be raising this with the
djang-enum
project instead?Any help/advice greatly appreciated