Open
Description
Bug report
Model.objects.create()
will correctly type check the kwargs for field names and types, whereas Model.objects.get_or_create()
does not. Notice how mypy catches the first line but misses the second (vscode plugin, mypy
CLI gives the same output)
These methods are affected:
acreate
aget_or_create
aupdate
aupdate_or_create
get_or_create
update
update_or_create
Many of the queryset methods are also missing field name checking, such as distinct
, exclude
, in_bulk
, etc. (not sure if this is possible due to query annotations)
System information
- OS: PopOS 22.04
python
version: 3.10.6django
version: 4.0.7mypy
version: 0.991django-stubs
version: 1.13.0django-stubs-ext
version: 0.7.0