Update stubs

This commit is contained in:
Trinh Anh Ngoc
2023-07-19 11:21:55 +07:00
parent f50b3f6031
commit 17c2d4b957
3 changed files with 9 additions and 20 deletions

View File

@@ -32,7 +32,7 @@ class Registry(Mapping[str, type[BaseModel]]):
field_depends_context: Collector
field_inverses: Collector
registry_sequence: int | None
cache_sequence: int | None
cache_sequences: dict
has_unaccent: bool
has_trigram: bool
def init(self, db_name: str) -> None: ...
@@ -75,17 +75,17 @@ class Registry(Mapping[str, type[BaseModel]]):
) -> None: ...
def check_foreign_keys(self, cr: Cursor) -> None: ...
def check_tables_exist(self, cr: Cursor) -> None: ...
def clear_caches(self) -> None: ...
def clear_cache(self, *cache_names) -> None: ...
def clear_all_caches(self) -> None: ...
def is_an_ordinary_table(self, model: BaseModel) -> bool: ...
@property
def registry_invalidated(self) -> bool: ...
@registry_invalidated.setter
def registry_invalidated(self, value: bool) -> None: ...
@property
def cache_invalidated(self) -> bool: ...
@cache_invalidated.setter
def cache_invalidated(self, value: bool) -> None: ...
def cache_invalidated(self) -> set: ...
def setup_signaling(self) -> None: ...
def get_sequences(self, cr: Cursor) -> tuple[int, dict]: ...
def check_signaling(self) -> Registry: ...
def signal_changes(self) -> None: ...
def reset_changes(self) -> None: ...

View File

@@ -4,7 +4,6 @@ from typing import Any, Callable, TypeVar
from ..models import BaseModel
from .lru import LRU
_T = TypeVar("_T")
_CallableT = TypeVar("_CallableT")
unsafe_eval = eval
@@ -22,9 +21,11 @@ STAT: defaultdict[Any, ormcache_counter]
class ormcache:
args: Any
skiparg: Any
cache_name: str
def __init__(self, *args, **kwargs) -> None: ...
method: Callable
def __call__(self, method: _CallableT) -> _CallableT: ...
def add_value(self, *args, cache_value: Any | None = ..., **kwargs) -> None: ...
key: Any
def determine_key(self): ...
def lru(
@@ -39,19 +40,6 @@ class ormcache_context(ormcache):
key: Any
def determine_key(self) -> None: ...
class ormcache_multi(ormcache):
multi: Any
def __init__(self, *args, **kwargs) -> None: ...
key_multi: Any
multi_pos: Any
def determine_key(self) -> None: ...
def lookup(self, method: Callable, *args, **kwargs): ...
class dummy_cache:
def __init__(self, *l, **kw) -> None: ...
def __call__(self, fn): ...
def clear(self, *l, **kw) -> None: ...
def log_ormcache_stats(sig: Any | None = ..., frame: Any | None = ...): ...
def get_cache_key_counter(bound_method, *args, **kwargs): ...

View File

@@ -4,7 +4,7 @@ from collections.abc import Mapping, MutableMapping, MutableSet
from contextlib import ContextDecorator, suppress
from logging import Handler, LogRecord
from re import Pattern
from types import ModuleType
from types import FrameType, ModuleType
from typing import (
IO,
Any,
@@ -312,3 +312,4 @@ def has_list_types(
values: list | tuple, types: Collection[type | tuple[type, ...]]
) -> bool: ...
def get_flag(country_code: str) -> str: ...
def format_frame(frame: FrameType) -> str: ...