django-stubs
django-stubs copied to clipboard
PEP-484 stubs for Django
# Bug report ## What's wrong django stubs is crashing with the below errror when I'm naming the field name ```type``` to models.CharField django model. error traceback ``` raise FieldDoesNotExist("%s...
# Bug report ## What's wrong It is indicated in the readme that all versions of `django-stubs >= 1.9.0` support `Django 3.2` (note: `1.12.0` is the latest `django-stubs` release at...
I'm experimenting with type annotations and chose a fairly simple project to add type annotations to (just a couple of additional Django checks). However I ran into the following: ##...
The existing annotation (`list[dict[Any, Any]]`) is incorrect, leading to errors in any code that actually uses this attribute. The proper type is evident from the code in Django that registers...
# Bug report ## What's wrong Similar to the existing type aliases defined within `django_stubs_ext` (E.g. `StrPromise`), it would be useful to have the `FieldOpts` type alias exposed for type...
https://github.com/typeddjango/django-stubs/pull/1495 updated `get_field_related_model_cls` to raise `UnregisteredModelError` rather than returning `None` for failure paths. However, None can still be returned if the initial retrieval of `related_model_cls` returns None. This patch adds...
# Bug report ## What's wrong - `from django_stubs_ext.db.models import manager` and using`related: manager.RelatedManager[OtherModel]` breaks Pylance type hints in VSCode - `from django.db.models import manager` and using`related: manager.RelatedManager[OtherModel]` breaks Mypy,...
# Bug report ## What's wrong mypy . --strict --explicit-package-bases ```Traceback (most recent call last): File "/Users/xx/Library/Caches/pypoetry/virtualenvs/xxx-CJszIqT8-py3.11/bin/mypy", line 8, in sys.exit(console_entry()) ^^^^^^^^^^^^^^^ File "/Users/xx/Library/Caches/pypoetry/virtualenvs/xxx-CJszIqT8-py3.11/lib/python3.11/site-packages/mypy/__main__.py", line 15, in console_entry main() File...
Fixes #1903
# I have made things! ## Related issues