Update stubs

This commit is contained in:
Trinh Anh Ngoc
2022-11-19 22:42:48 +07:00
parent 75241bec43
commit 94e0fd96c5

View File

@@ -1,68 +1,73 @@
from ..models import MAGIC_COLUMNS as MAGIC_COLUMNS
from functools import partial as partial from functools import partial as partial
from typing import Any, Optional from typing import Any, Callable
from ..models import BaseModel, MAGIC_COLUMNS as MAGIC_COLUMNS
from ..sql_db import Cursor
from ..tools.misc import get_lang as get_lang
_Domain = list
NOT_OPERATOR: str NOT_OPERATOR: str
OR_OPERATOR: str OR_OPERATOR: str
AND_OPERATOR: str AND_OPERATOR: str
DOMAIN_OPERATORS: Any DOMAIN_OPERATORS: tuple[str, ...]
TERM_OPERATORS: Any TERM_OPERATORS: tuple[str, ...]
NEGATIVE_TERM_OPERATORS: Any NEGATIVE_TERM_OPERATORS: tuple[str, ...]
DOMAIN_OPERATORS_NEGATION: Any DOMAIN_OPERATORS_NEGATION: dict[str, str]
TERM_OPERATORS_NEGATION: Any TERM_OPERATORS_NEGATION: dict[str, str]
TRUE_LEAF: Any TRUE_LEAF: tuple
FALSE_LEAF: Any FALSE_LEAF: tuple
TRUE_DOMAIN: Any TRUE_DOMAIN: list[tuple]
FALSE_DOMAIN: Any FALSE_DOMAIN: list[tuple]
_logger: Any
def normalize_domain(domain: Any): ... def normalize_domain(domain: _Domain) -> _Domain: ...
def is_false(model: Any, domain: Any): ... def is_false(model, domain: _Domain) -> bool: ...
def combine(operator: Any, unit: Any, zero: Any, domains: Any): ... def combine(operator: str, unit, zero, domains: list[_Domain]) -> _Domain: ...
def AND(domains: Any): ... def AND(domains: list[_Domain]) -> _Domain: ...
def OR(domains: Any): ... def OR(domains: list[_Domain]) -> _Domain: ...
def distribute_not(domain: Any): ... def distribute_not(domain: _Domain) -> _Domain: ...
def _quote(to_quote: Any): ... def _quote(to_quote: str) -> str: ...
def _shorten_alias(alias: Any): ... def _shorten_alias(alias: str) -> str: ...
def generate_table_alias(src_table_alias: Any, joined_tables: Any = ...): ... def generate_table_alias(src_table_alias: str, joined_tables: list = ...) -> tuple[str, str]: ...
def get_alias_from_query(from_query: Any): ... def get_alias_from_query(from_query: str) -> tuple[str, str]: ...
def normalize_leaf(element: Any): ... def normalize_leaf(element): ...
def is_operator(element: Any): ... def is_operator(element) -> bool: ...
def is_leaf(element: Any, internal: bool = ...): ... def is_leaf(element, internal: bool = ...) -> bool: ...
def select_from_where(cr: Any, select_field: Any, from_table: Any, where_field: Any, where_ids: Any, where_operator: Any): ... def select_from_where(cr: Cursor, select_field: str, from_table: str, where_field: str, where_ids: list[int], where_operator: str) -> list: ...
def select_distinct_from_where_not_null(cr: Any, select_field: Any, from_table: Any): ... def select_distinct_from_where_not_null(cr: Cursor, select_field: str, from_table: str) -> list: ...
def get_unaccent_wrapper(cr: Any): ... def get_unaccent_wrapper(cr: Cursor) -> Callable[[Any], str]: ...
class ExtendedLeaf: class ExtendedLeaf:
join_context: Any = ... join_context: list[tuple]
leaf: Any = ... leaf: Any
model: Any = ... model: BaseModel
_models: Any = ... _models: list[BaseModel]
def __init__(self, leaf: Any, model: Any, join_context: Optional[Any] = ..., internal: bool = ...) -> None: ... def __init__(self, leaf, model: BaseModel, join_context: list[tuple] | None = ..., internal: bool = ...) -> None: ...
def __str__(self): ... def __str__(self) -> str: ...
def generate_alias(self): ... def generate_alias(self) -> str: ...
def add_join_context(self, model: Any, lhs_col: Any, table_col: Any, link: Any) -> None: ... def add_join_context(self, model, lhs_col, table_col, link) -> None: ...
def get_join_conditions(self): ... def get_join_conditions(self) -> list[str]: ...
def get_tables(self): ... def get_tables(self) -> set[str]: ...
def _get_context_debug(self): ... def _get_context_debug(self) -> list[str]: ...
def check_leaf(self, internal: bool = ...) -> None: ... def check_leaf(self, internal: bool = ...) -> None: ...
def is_operator(self): ... def is_operator(self) -> bool: ...
def is_true_leaf(self): ... def is_true_leaf(self) -> bool: ...
def is_false_leaf(self): ... def is_false_leaf(self) -> bool: ...
def is_leaf(self, internal: bool = ...): ... def is_leaf(self, internal: bool = ...): ...
def normalize_leaf(self): ... def normalize_leaf(self) -> bool: ...
def create_substitution_leaf(leaf: Any, new_elements: Any, new_model: Optional[Any] = ..., internal: bool = ...): ... def create_substitution_leaf(leaf: ExtendedLeaf, new_elements, new_model: BaseModel | None = ..., internal: bool = ...) -> ExtendedLeaf: ...
class expression: class expression:
_unaccent: Any = ... _unaccent: Callable[[Any], str]
joins: Any = ... joins: list
root_model: Any = ... root_model: BaseModel
expression: Any = ... expression: _Domain
def __init__(self, domain: Any, model: Any) -> None: ... result: tuple[str, list]
def get_tables(self): ... def __init__(self, domain: _Domain, model: BaseModel) -> None: ...
result: Any = ... def get_tables(self) -> tuple[str, ...]: ...
stack: Any = ... result: list
stack: list
def parse(self): ... def parse(self): ...
def __leaf_to_sql(self, eleaf: Any): ... def __leaf_to_sql(self, eleaf: ExtendedLeaf) -> tuple[str, list]: ...
def to_sql(self): ... def to_sql(self) -> tuple[str, list]: ...