Update stubs

This commit is contained in:
Trinh Anh Ngoc
2023-08-27 16:17:05 +07:00
parent 59abe0e28e
commit 4fb1add889
5 changed files with 34 additions and 9 deletions

View File

@@ -73,7 +73,6 @@ class Field(Generic[_FieldValueT], metaclass=MetaField):
default: Any default: Any
string: str | None string: str | None
help: str | None help: str | None
invisible: bool
readonly: bool readonly: bool
required: bool required: bool
states: dict[str, list[tuple]] | None states: dict[str, list[tuple]] | None

View File

@@ -30,6 +30,7 @@ DEFAULT_LANG: str
def get_default_session() -> dict[str, Any]: ... def get_default_session() -> dict[str, Any]: ...
DEFAULT_MAX_CONTENT_LENGTH: int
GEOIP_EMPTY_COUNTRY: geoip2.models.Country GEOIP_EMPTY_COUNTRY: geoip2.models.Country
GEOIP_EMPTY_CITY: geoip2.models.City GEOIP_EMPTY_CITY: geoip2.models.City
JSON_MIMETYPES: tuple[str, ...] JSON_MIMETYPES: tuple[str, ...]

View File

@@ -280,9 +280,6 @@ class BaseModel(metaclass=MetaModel):
orderby: str | None = ..., orderby: str | None = ...,
lazy: bool = ..., lazy: bool = ...,
) -> list[dict[str, Any]]: ... ) -> list[dict[str, Any]]: ...
def _inherits_join_add(
self, current_model: BaseModel, parent_model_name: str, query: Query
) -> str: ...
def _inherits_join_calc(self, alias: str, fname: str, query: Query) -> str: ... def _inherits_join_calc(self, alias: str, fname: str, query: Query) -> str: ...
def _parent_store_compute(self): ... def _parent_store_compute(self): ...
def _check_removed_columns(self, log: bool = ...) -> None: ... def _check_removed_columns(self, log: bool = ...) -> None: ...

View File

@@ -1,11 +1,13 @@
import collections import collections
from typing import Any, Generic, Iterator, TypeVar from typing import Any, Generic, Iterable, Iterator, TypeVar
from ..models import BaseModel from ..models import BaseModel
_ModelT = TypeVar("_ModelT", bound=BaseModel) _ModelT = TypeVar("_ModelT", bound=BaseModel)
_FormT = TypeVar("_FormT", bound=Form) _FormT = TypeVar("_FormT", bound=Form)
MODIFIER_ALIASES: dict
class Form(Generic[_ModelT]): class Form(Generic[_ModelT]):
def __init__(self, record: _ModelT, view: Any | None = ...) -> None: ... def __init__(self, record: _ModelT, view: Any | None = ...) -> None: ...
def __getattr__(self, field_name: str): ... def __getattr__(self, field_name: str): ...
@@ -24,15 +26,40 @@ class O2MForm(Form):
class UpdateDict(dict): class UpdateDict(dict):
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
def __repr__(self) -> str: ...
def changed_items(self) -> Iterator[tuple]: ... def changed_items(self) -> Iterator[tuple]: ...
def update(self, *args, **kw) -> None: ... def update(self, *args, **kw) -> None: ...
def clear(self) -> None: ... def clear(self) -> None: ...
class X2MValue(collections.abc.Sequence):
def __init__(self, iterable_of_vals: Iterable = ...) -> None: ...
def __repr__(self) -> str: ...
def __contains__(self, id_) -> bool: ...
def __getitem__(self, index): ...
def __iter__(self) -> Iterator: ...
def __len__(self) -> int: ...
def __eq__(self, other) -> bool: ...
def get_vals(self, id_): ...
def add(self, id_, vals) -> None: ...
def remove(self, id_) -> None: ...
def clear(self) -> None: ...
def create(self, vals) -> None: ...
def update(self, id_, changes, changed=...) -> None: ...
def to_list_of_vals(self) -> list: ...
class O2MValue(X2MValue):
def __init__(self, iterable_of_vals: Iterable = ...) -> None: ...
def to_commands(self, convert_values=...) -> list: ...
class M2MValue(X2MValue):
def to_commands(self) -> list: ...
class X2MProxy: class X2MProxy:
def __init__(self, form: Form, field_name: str) -> None: ... def __init__(self, form: Form, field_name: str) -> None: ...
@property
def ids(self) -> list: ...
class O2MProxy(X2MProxy): class O2MProxy(X2MProxy):
def __init__(self, form: Form, field_name: str) -> None: ...
def __len__(self) -> int: ... def __len__(self) -> int: ...
def new(self) -> O2MForm: ... def new(self) -> O2MForm: ...
def edit(self, index: int) -> O2MForm: ... def edit(self, index: int) -> O2MForm: ...
@@ -48,7 +75,8 @@ class M2MProxy(X2MProxy, collections.abc.Sequence):
def set(self, records: BaseModel) -> None: ... def set(self, records: BaseModel) -> None: ...
def clear(self) -> None: ... def clear(self) -> None: ...
def read_record(record: BaseModel, fields: dict) -> dict: ... def convert_read_to_form(values: dict, fields: dict) -> dict: ...
def get_static_context(context_str: str) -> dict: ...
class Dotter: class Dotter:
def __init__(self, values) -> None: ... def __init__(self, values) -> None: ...

View File

@@ -8,9 +8,9 @@ _CallableT = TypeVar("_CallableT", bound=Callable)
READONLY: Pattern READONLY: Pattern
def get_variable_names(expr: str | _expr) -> set[str]: ... def get_domain_value_names(domain) -> tuple[set[str], set[str]]: ...
def get_expression_field_names(expression) -> set[str]: ...
def get_dict_asts(expr: str | _expr) -> dict: ... def get_dict_asts(expr: str | _expr) -> dict: ...
def get_domain_identifiers(expr: str | _expr) -> tuple[set[str], set[str]]: ...
def valid_view(arch: _Element, **kwargs) -> bool: ... def valid_view(arch: _Element, **kwargs) -> bool: ...
def validate(*view_types: str) -> Callable[[_CallableT], _CallableT]: ... def validate(*view_types: str) -> Callable[[_CallableT], _CallableT]: ...
def relaxng(view_type: str) -> RelaxNG: ... def relaxng(view_type: str) -> RelaxNG: ...