How can I fix pycham wrong django type hint
member_meta_models: QuerySet[MemberWantedMetaModel] = MemberWantedMetaModel.objects.filter(member_id=member_id) Pycharm says “Expected type QuerySet[MemberWantedMetaModel,MemberWantedMetaModel], got QuerySet[MemberWantedMetaModel] I think type hint is right. How Can I fix it. If my type hint is wrong, How can I fix it? (I am using python 3.13.0, Django 5.1.4 mypy, pydantic) Thanks python django mypy New contributor 은창현 is a new contributor to this […]
Mypy: properly typing a Django mixin class when accessing a method on super()
Django has a quirk where it doesn’t validate models by default before writing to the database. A non-ideal situation that devs try to work around by creating a Mixin class for example:
https://www.xormedia.com/django-model-validation-on-save/