create dummy classes for custom_manager_of_model usecase

This commit is contained in:
Maxim Kurnikov
2019-07-21 00:41:21 +03:00
parent 6962b42cba
commit d7d379e1cd
6 changed files with 75 additions and 30 deletions

View File

@@ -9,8 +9,9 @@ class BaseManager(QuerySet[_T, _T]):
creation_counter: int = ...
auto_created: bool = ...
use_in_migrations: bool = ...
model: Optional[Any] = ...
name: Optional[Any] = ...
name: str = ...
model: Type[Model] = ...
db: str
def __init__(self) -> None: ...
def deconstruct(self) -> Tuple[bool, str, None, Tuple, Dict[str, int]]: ...
def check(self, **kwargs: Any) -> List[Any]: ...
@@ -34,8 +35,4 @@ class ManagerDescriptor:
def __get__(self, instance: Optional[Model], cls: Type[Model] = ...) -> Manager: ...
class EmptyManager(Manager):
creation_counter: int
name: None
model: Optional[Type[Model]] = ...
def __init__(self, model: Type[Model]) -> None: ...
def get_queryset(self) -> QuerySet: ...

View File

@@ -37,8 +37,6 @@ class Options(Generic[_M]):
default_manager: Manager
fields: ImmutableList
local_concrete_fields: ImmutableList
managers: ImmutableList
managers_map: Dict[str, Manager]
related_objects: ImmutableList
FORWARD_PROPERTIES: Any = ...
REVERSE_PROPERTIES: Any = ...
@@ -106,6 +104,10 @@ class Options(Generic[_M]):
def many_to_many(self) -> List[ManyToManyField]: ...
@property
def fields_map(self) -> Dict[str, Union[Field, ForeignObjectRel]]: ...
@property
def managers(self) -> List[Manager]: ...
@property
def managers_map(self) -> Dict[str, Manager]: ...
def get_field(self, field_name: Union[Callable, str]) -> Field: ...
def get_base_chain(self, model: Type[Model]) -> List[Type[Model]]: ...
def get_parent_list(self) -> List[Type[Model]]: ...