diff --git a/django-stubs/db/models/sql/compiler.pyi b/django-stubs/db/models/sql/compiler.pyi index 8c365fe09..b000631be 100644 --- a/django-stubs/db/models/sql/compiler.pyi +++ b/django-stubs/db/models/sql/compiler.pyi @@ -7,7 +7,7 @@ from uuid import UUID from django.db.backends.base.base import BaseDatabaseWrapper from django.db.backends.utils import CursorWrapper from django.db.models.base import Model -from django.db.models.expressions import BaseExpression, Expression +from django.db.models.expressions import BaseExpression, Expression, Ref from django.db.models.sql.query import Query from django.db.models.sql.subqueries import AggregateQuery, DeleteQuery, InsertQuery, UpdateQuery from django.utils.functional import cached_property @@ -18,6 +18,9 @@ _ParamT: TypeAlias = str | int _ParamsT: TypeAlias = list[_ParamT] _AsSqlType: TypeAlias = tuple[str, _ParamsT] +class PositionRef(Ref): + def __init__(self, ordinal: str, refs: str, source: Expression) -> None: ... + class SQLCompiler: query: Query connection: BaseDatabaseWrapper diff --git a/scripts/stubtest/allowlist_todo.txt b/scripts/stubtest/allowlist_todo.txt index 111c84dcd..42cdf788a 100644 --- a/scripts/stubtest/allowlist_todo.txt +++ b/scripts/stubtest/allowlist_todo.txt @@ -1231,7 +1231,6 @@ django.db.models.sql.Query.names_to_path django.db.models.sql.Query.solve_lookup_type django.db.models.sql.Query.table_alias django.db.models.sql.XOR -django.db.models.sql.compiler.PositionRef django.db.models.sql.compiler.SQLCompiler.__init__ django.db.models.sql.compiler.SQLCompiler.deferred_to_columns django.db.models.sql.compiler.SQLCompiler.get_default_columns