|
2 | 2 |
|
3 | 3 | from typing import Any
|
4 | 4 | from typing import Callable
|
5 |
| -from typing import Iterable |
6 | 5 | from typing import cast
|
7 | 6 |
|
8 | 7 | from django.core import checks
|
|
14 | 13 | from django.db.models import Model
|
15 | 14 | from django.db.models import TextField
|
16 | 15 | from django.db.models.expressions import BaseExpression
|
| 16 | +from django.db.models.sql.compiler import SQLCompiler |
17 | 17 | from django.forms import Field as FormField
|
18 | 18 | from django.utils.translation import gettext_lazy as _
|
19 | 19 |
|
@@ -230,10 +230,10 @@ def __init__(self, index: int, *args: Any, **kwargs: Any) -> None:
|
230 | 230 | self.index = index
|
231 | 231 |
|
232 | 232 | def as_sql(
|
233 |
| - self, qn: Callable[[str], str], connection: BaseDatabaseWrapper |
234 |
| - ) -> tuple[str, Iterable[Any]]: |
235 |
| - lhs, lhs_params = self.process_lhs(qn, connection) |
236 |
| - rhs, rhs_params = self.process_rhs(qn, connection) |
| 233 | + self, compiler: SQLCompiler, connection: BaseDatabaseWrapper |
| 234 | + ) -> tuple[str, list[str | int]]: |
| 235 | + lhs, lhs_params = self.process_lhs(compiler, connection) |
| 236 | + rhs, rhs_params = self.process_rhs(compiler, connection) |
237 | 237 | params = tuple(lhs_params) + tuple(rhs_params)
|
238 | 238 | # Put rhs on the left since that's the order FIND_IN_SET uses
|
239 | 239 | return f"(FIND_IN_SET({rhs}, {lhs}) = {self.index})", params
|
|
0 commit comments