mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 21:14:49 +08:00
Model.objects should be a ClassVar
Model.objects is only available on classes and while we cannot force this, without ClassVar it's kind of only available on instances. I have noticed this when I was writing a Jedi plugin that makes django-stubs work properly.
This commit is contained in:
committed by
Adam Johnson
parent
1d78b8ffac
commit
7c995572c6
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Collection, Dict, Iterable, List, Optional, Sequence, Set, Tuple, Type, TypeVar, Union
|
||||
from typing import Any, ClassVar, Collection, Dict, Iterable, List, Optional, Sequence, Set, Tuple, Type, TypeVar, Union
|
||||
|
||||
from django.core.checks.messages import CheckMessage
|
||||
from django.core.exceptions import MultipleObjectsReturned as BaseMultipleObjectsReturned
|
||||
@@ -29,7 +29,7 @@ class Model(metaclass=ModelBase):
|
||||
@classproperty
|
||||
@classmethod
|
||||
def _base_manager(cls: Type[_Self]) -> BaseManager[_Self]: ...
|
||||
objects: BaseManager[Any]
|
||||
objects: ClassVar[BaseManager[Any]]
|
||||
pk: Any = ...
|
||||
_state: ModelState
|
||||
def __init__(self: _Self, *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user