mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 21:46:43 +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:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Collection, Dict, Iterable, List, Optional, Set, Tuple, Type, TypeVar, Union
|
||||
from typing import Any, Callable, Collection, Dict, Iterable, List, Optional, Set, Tuple, Type, TypeVar, Union, ClassVar
|
||||
|
||||
from django.core.checks.messages import CheckMessage
|
||||
from django.core.exceptions import (
|
||||
@@ -26,7 +26,7 @@ class Model(metaclass=ModelBase):
|
||||
class Meta: ...
|
||||
_meta: Options[Any]
|
||||
_default_manager: BaseManager[Model]
|
||||
objects: BaseManager[Any]
|
||||
objects: ClassVar[BaseManager[Any]]
|
||||
pk: Any = ...
|
||||
_state: ModelState
|
||||
def __init__(self: _Self, *args, **kwargs) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user