From fa2aa24ec25f287c7bcad915d92e0ab3f261d0d1 Mon Sep 17 00:00:00 2001 From: ashm-dev Date: Sun, 4 Aug 2024 10:51:14 +0300 Subject: [PATCH 1/5] fix bug --- ext/django_stubs_ext/patch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/django_stubs_ext/patch.py b/ext/django_stubs_ext/patch.py index 795726abb..d9b4bebc0 100644 --- a/ext/django_stubs_ext/patch.py +++ b/ext/django_stubs_ext/patch.py @@ -22,6 +22,7 @@ from django.views.generic.detail import SingleObjectMixin from django.views.generic.edit import DeletionMixin, FormMixin from django.views.generic.list import MultipleObjectMixin +from django.db.models.query import RawQuerySet __all__ = ["monkeypatch"] @@ -78,6 +79,7 @@ def __repr__(self) -> str: MPGeneric(BaseManager, (3, 1)), # These types do have native `__class_getitem__` method since django 4.1: MPGeneric(ForeignKey, (4, 1)), + MPGeneric(RawQuerySet), ] From beb7cd7172b8f22cc868e99278122583189af201 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 4 Aug 2024 07:53:17 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks --- ext/django_stubs_ext/patch.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/django_stubs_ext/patch.py b/ext/django_stubs_ext/patch.py index d9b4bebc0..5d583767f 100644 --- a/ext/django_stubs_ext/patch.py +++ b/ext/django_stubs_ext/patch.py @@ -15,14 +15,13 @@ from django.db.models.fields.related_descriptors import ReverseManyToOneDescriptor from django.db.models.lookups import Lookup from django.db.models.manager import BaseManager -from django.db.models.query import QuerySet +from django.db.models.query import QuerySet, RawQuerySet from django.forms.formsets import BaseFormSet from django.forms.models import BaseModelForm, BaseModelFormSet, ModelChoiceField from django.utils.connection import BaseConnectionHandler from django.views.generic.detail import SingleObjectMixin from django.views.generic.edit import DeletionMixin, FormMixin from django.views.generic.list import MultipleObjectMixin -from django.db.models.query import RawQuerySet __all__ = ["monkeypatch"] From 10415c13c1c15601a7abed6faabc6a9408e127e4 Mon Sep 17 00:00:00 2001 From: Shamil Date: Sun, 4 Aug 2024 12:39:57 +0300 Subject: [PATCH 3/5] Fixed EmailField --- django-stubs/db/models/fields/__init__.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django-stubs/db/models/fields/__init__.pyi b/django-stubs/db/models/fields/__init__.pyi index d07e2e194..67c4e5a2b 100644 --- a/django-stubs/db/models/fields/__init__.pyi +++ b/django-stubs/db/models/fields/__init__.pyi @@ -356,7 +356,9 @@ class SlugField(CharField[_ST, _GT]): allow_unicode: bool = ..., ) -> None: ... -class EmailField(CharField[_ST, _GT]): ... +class EmailField(CharField[_ST, _GT]): + _pyi_private_set_type: str | Combinable + _pyi_private_get_type: str class URLField(CharField[_ST, _GT]): def __init__( From ed784cecc10bbab3b66337a9f353fc125defb529 Mon Sep 17 00:00:00 2001 From: Shamil Date: Sun, 4 Aug 2024 13:32:39 +0300 Subject: [PATCH 4/5] Fixed --- django-stubs/db/models/fields/__init__.pyi | 1 - django-stubs/db/models/sql/compiler.pyi | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/django-stubs/db/models/fields/__init__.pyi b/django-stubs/db/models/fields/__init__.pyi index 67c4e5a2b..fa7413780 100644 --- a/django-stubs/db/models/fields/__init__.pyi +++ b/django-stubs/db/models/fields/__init__.pyi @@ -358,7 +358,6 @@ class SlugField(CharField[_ST, _GT]): class EmailField(CharField[_ST, _GT]): _pyi_private_set_type: str | Combinable - _pyi_private_get_type: str class URLField(CharField[_ST, _GT]): def __init__( diff --git a/django-stubs/db/models/sql/compiler.pyi b/django-stubs/db/models/sql/compiler.pyi index 16ace84fb..049493904 100644 --- a/django-stubs/db/models/sql/compiler.pyi +++ b/django-stubs/db/models/sql/compiler.pyi @@ -13,9 +13,9 @@ from django.db.models.sql.subqueries import AggregateQuery, DeleteQuery, InsertQ from django.utils.functional import cached_property from typing_extensions import TypeAlias -_ParamT: TypeAlias = str | int +_ParamT: TypeAlias = Any -_ParamsT: TypeAlias = list[_ParamT] +_ParamsT: TypeAlias = tuple[_ParamT, ...] _AsSqlType: TypeAlias = tuple[str, _ParamsT] class PositionRef(Ref): From 666c7b4c772e74a206e3ad1ee4a6977210a42697 Mon Sep 17 00:00:00 2001 From: Shamil Date: Sun, 4 Aug 2024 14:19:20 +0300 Subject: [PATCH 5/5] Fixed --- django-stubs/db/models/sql/compiler.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/db/models/sql/compiler.pyi b/django-stubs/db/models/sql/compiler.pyi index 049493904..16ace84fb 100644 --- a/django-stubs/db/models/sql/compiler.pyi +++ b/django-stubs/db/models/sql/compiler.pyi @@ -13,9 +13,9 @@ from django.db.models.sql.subqueries import AggregateQuery, DeleteQuery, InsertQ from django.utils.functional import cached_property from typing_extensions import TypeAlias -_ParamT: TypeAlias = Any +_ParamT: TypeAlias = str | int -_ParamsT: TypeAlias = tuple[_ParamT, ...] +_ParamsT: TypeAlias = list[_ParamT] _AsSqlType: TypeAlias = tuple[str, _ParamsT] class PositionRef(Ref):