mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 04:54:48 +08:00
add custom_lookups, custom_managers test folders
This commit is contained in:
@@ -4,6 +4,7 @@ from django.db.models.base import Model
|
|||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
_T = TypeVar("_T", bound=Model, covariant=True)
|
_T = TypeVar("_T", bound=Model, covariant=True)
|
||||||
|
_Self = TypeVar('_Self', bound='BaseManager')
|
||||||
|
|
||||||
class BaseManager(QuerySet[_T]):
|
class BaseManager(QuerySet[_T]):
|
||||||
creation_counter: int = ...
|
creation_counter: int = ...
|
||||||
@@ -16,7 +17,7 @@ class BaseManager(QuerySet[_T]):
|
|||||||
def deconstruct(self) -> Tuple[bool, str, None, Tuple, Dict[str, int]]: ...
|
def deconstruct(self) -> Tuple[bool, str, None, Tuple, Dict[str, int]]: ...
|
||||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_queryset(cls, queryset_class: Any, class_name: Optional[Any] = ...): ...
|
def from_queryset(cls: Type[_Self], queryset_class: Any, class_name: Optional[Any] = ...) -> Type[_Self]: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_queryset_methods(cls, queryset_class: type) -> Dict[str, Any]: ...
|
def _get_queryset_methods(cls, queryset_class: type) -> Dict[str, Any]: ...
|
||||||
def contribute_to_class(self, model: Type[Model], name: str) -> None: ...
|
def contribute_to_class(self, model: Type[Model], name: str) -> None: ...
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ IGNORED_ERRORS = {
|
|||||||
# settings
|
# settings
|
||||||
re.compile(r'Module has no attribute "[A-Z_]+"'),
|
re.compile(r'Module has no attribute "[A-Z_]+"'),
|
||||||
# attributes assigned to test functions
|
# attributes assigned to test functions
|
||||||
re.compile(r'"Callable\[\[(Any(, )?)+\], Any\]" has no attribute'),
|
re.compile(r'"Callable\[\[(Any(, )?)+(, VarArg\(Any\))?(, KwArg\(Any\))?\], Any\]" has no attribute'),
|
||||||
# assign empty tuple
|
# assign empty tuple
|
||||||
re.compile(r'Incompatible types in assignment \(expression has type "Tuple\[\]", '
|
re.compile(r'Incompatible types in assignment \(expression has type "Tuple\[\]", '
|
||||||
r'variable has type "Tuple\[[A-Za-z, ]+\]"'),
|
r'variable has type "Tuple\[[A-Za-z, ]+\]"'),
|
||||||
@@ -70,6 +70,19 @@ IGNORED_ERRORS = {
|
|||||||
'builtin_server': [
|
'builtin_server': [
|
||||||
'has no attribute "getvalue"'
|
'has no attribute "getvalue"'
|
||||||
],
|
],
|
||||||
|
'custom_lookups': [
|
||||||
|
'in base class "SQLFuncMixin"'
|
||||||
|
],
|
||||||
|
'custom_managers': [
|
||||||
|
'_filter_CustomQuerySet',
|
||||||
|
'_filter_CustomManager',
|
||||||
|
re.compile(r'Cannot determine type of \'(abstract_persons|cars|plain_manager)\''),
|
||||||
|
# TODO: remove after 'objects' and '_default_manager' are handled in the plugin
|
||||||
|
'Incompatible types in assignment (expression has type "CharField", '
|
||||||
|
+ 'base class "Model" defined the type as "Manager[Model]")',
|
||||||
|
# TODO: remove after from_queryset() handled in the plugin
|
||||||
|
'Invalid base class'
|
||||||
|
],
|
||||||
'csrf_tests': [
|
'csrf_tests': [
|
||||||
'Incompatible types in assignment (expression has type "property", ' +
|
'Incompatible types in assignment (expression has type "property", ' +
|
||||||
'base class "HttpRequest" defined the type as "QueryDict")'
|
'base class "HttpRequest" defined the type as "QueryDict")'
|
||||||
@@ -167,8 +180,8 @@ TESTS_DIRS = [
|
|||||||
'context_processors',
|
'context_processors',
|
||||||
'csrf_tests',
|
'csrf_tests',
|
||||||
'custom_columns',
|
'custom_columns',
|
||||||
# TODO: 'custom_lookups',
|
'custom_lookups',
|
||||||
# TODO: 'custom_managers',
|
'custom_managers',
|
||||||
'custom_methods',
|
'custom_methods',
|
||||||
'custom_migration_operations',
|
'custom_migration_operations',
|
||||||
'custom_pk',
|
'custom_pk',
|
||||||
|
|||||||
Reference in New Issue
Block a user