File: where.pyi

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (52 lines) | stat: -rw-r--r-- 2,065 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from collections.abc import Sequence
from typing import Any, Final

from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.models.expressions import Expression
from django.db.models.fields import BooleanField
from django.db.models.sql.compiler import SQLCompiler, _AsSqlType, _ParamsT
from django.utils import tree
from django.utils.functional import cached_property

AND: Final = "AND"
OR: Final = "OR"
XOR: Final = "XOR"

class WhereNode(tree.Node):
    connector: str
    negated: bool
    default: str
    resolved: bool
    conditional: bool
    def split_having(self, negated: bool = ...) -> tuple[WhereNode | None, WhereNode | None]: ...
    def as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ...
    def get_group_by_cols(self, alias: str | None = ...) -> list[Expression]: ...
    def relabel_aliases(self, change_map: dict[str | None, str]) -> None: ...
    def clone(self) -> WhereNode: ...
    def relabeled_clone(self, change_map: dict[str | None, str]) -> WhereNode: ...
    def resolve_expression(self, *args: Any, **kwargs: Any) -> WhereNode: ...
    @cached_property
    def output_field(self) -> BooleanField: ...
    def get_refs(self) -> set[str]: ...
    @cached_property
    def contains_aggregate(self) -> bool: ...
    @cached_property
    def contains_over_clause(self) -> bool: ...
    @property
    def is_summary(self) -> bool: ...
    def select_format(self, compiler: SQLCompiler, sql: str, params: _ParamsT) -> _AsSqlType: ...

class NothingNode:
    contains_aggregate: bool
    def as_sql(
        self, compiler: SQLCompiler | None = None, connection: BaseDatabaseWrapper | None = None
    ) -> _AsSqlType: ...

class ExtraWhere:
    contains_aggregate: bool
    sqls: Sequence[str]
    params: Sequence[int] | Sequence[str] | None
    def __init__(self, sqls: Sequence[str], params: Sequence[int] | Sequence[str] | None) -> None: ...
    def as_sql(
        self, compiler: SQLCompiler | None = None, connection: BaseDatabaseWrapper | None = None
    ) -> _AsSqlType: ...