This commit is contained in:
Maxim Kurnikov
2019-07-21 03:31:30 +03:00
parent a0db24c764
commit 2c001fd8a7
6 changed files with 36 additions and 186 deletions

View File

@@ -2,8 +2,8 @@ import collections
from collections import OrderedDict, namedtuple
from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Set, Tuple, Type, Union
from django.db.models.lookups import Lookup
from django.db.models.query_utils import PathInfo
from django.db.models.lookups import Lookup, Transform
from django.db.models.query_utils import PathInfo, RegisterLookupMixin
from django.db.models.sql.compiler import SQLCompiler
from django.db.models.sql.datastructures import BaseTable
from django.db.models.sql.where import WhereNode
@@ -69,6 +69,8 @@ class Query:
explain_query: bool = ...
explain_format: Optional[str] = ...
explain_options: Dict[str, int] = ...
high_mark: Optional[int] = ...
low_mark: int = ...
def __init__(self, model: Optional[Type[Model]], where: Type[WhereNode] = ...) -> None: ...
@property
def extra(self) -> OrderedDict: ...
@@ -141,8 +143,6 @@ class Query:
) -> Tuple[WhereNode, Tuple]: ...
def set_empty(self) -> None: ...
def is_empty(self) -> bool: ...
high_mark: Optional[int] = ...
low_mark: int = ...
def set_limits(self, low: Optional[int] = ..., high: Optional[int] = ...) -> None: ...
def clear_limits(self) -> None: ...
def has_limit_one(self) -> bool: ...
@@ -178,7 +178,10 @@ class Query:
def set_values(self, fields: Union[List[str], Tuple]) -> None: ...
def trim_start(self, names_with_path: List[Tuple[str, List[PathInfo]]]) -> Tuple[str, bool]: ...
def is_nullable(self, field: Field) -> bool: ...
def build_lookup(self, lookups: Sequence[str], lhs: Query, rhs: Optional[Query]) -> Lookup: ...
def build_lookup(
self, lookups: Sequence[str], lhs: Union[RegisterLookupMixin, Query], rhs: Optional[Query]
) -> Lookup: ...
def try_transform(self, lhs: Union[RegisterLookupMixin, Query], name: str) -> Transform: ...
class JoinPromoter:
connector: str = ...