File: subqueries.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 (44 lines) | stat: -rw-r--r-- 1,696 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
from collections.abc import Iterable
from typing import Any

from django.db.models.base import Model
from django.db.models.expressions import Case
from django.db.models.fields import Field
from django.db.models.sql.query import Query
from django.db.models.sql.where import WhereNode

class DeleteQuery(Query):
    select: tuple
    where_class: type[WhereNode]
    where: WhereNode
    def do_query(self, table: str, where: WhereNode, using: str) -> int: ...
    def delete_batch(self, pk_list: list[int] | list[str], using: str) -> int: ...

class UpdateQuery(Query):
    select: tuple
    where_class: type[WhereNode]
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...
    where: WhereNode
    def update_batch(self, pk_list: list[int], values: dict[str, int | None], using: str) -> None: ...
    def add_update_values(self, values: dict[str, Any]) -> None: ...
    def add_update_fields(self, values_seq: list[tuple[Field, type[Model] | None, Case]]) -> None: ...
    def add_related_update(self, model: type[Model], field: Field, value: int | str) -> None: ...
    def get_related_updates(self) -> list[UpdateQuery]: ...

class InsertQuery(Query):
    select: tuple
    where: WhereNode
    where_class: type[WhereNode]
    fields: Iterable[Field]
    objs: list[Model]
    raw: bool
    def __init__(self, *args: Any, ignore_conflicts: bool = ..., **kwargs: Any) -> None: ...
    def insert_values(self, fields: Iterable[Field], objs: list[Model], raw: bool = False) -> None: ...

class AggregateQuery(Query):
    select: tuple
    sub_params: tuple
    where: WhereNode
    where_class: type[WhereNode]

__all__ = ["AggregateQuery", "DeleteQuery", "InsertQuery", "UpdateQuery"]