mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-07 12:44:29 +08:00
various annotation improvements (#258)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
black
|
black
|
||||||
pytest-mypy-plugins==1.1.0
|
pytest-mypy-plugins==1.1.0
|
||||||
psycopg2
|
psycopg2
|
||||||
flake8==3.7.8
|
flake8==3.7.9
|
||||||
flake8-pyi==19.3.0
|
flake8-pyi==19.3.0
|
||||||
isort==4.3.21
|
isort==4.3.21
|
||||||
gitpython==3.0.5
|
gitpython==3.0.5
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
from typing import Any, List, Union
|
from typing import Any, List, Union, Iterable, Optional
|
||||||
|
|
||||||
from django.contrib.admin.options import BaseModelAdmin
|
from django.contrib.admin.options import BaseModelAdmin
|
||||||
from django.core.checks.messages import Error
|
from django.core.checks.messages import Error
|
||||||
|
|
||||||
|
from django.apps.config import AppConfig
|
||||||
|
|
||||||
_CheckError = Union[str, Error]
|
_CheckError = Union[str, Error]
|
||||||
|
|
||||||
def check_admin_app(app_configs: None, **kwargs: Any) -> List[_CheckError]: ...
|
def check_admin_app(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[_CheckError]: ...
|
||||||
def check_dependencies(**kwargs: Any) -> List[_CheckError]: ...
|
def check_dependencies(**kwargs: Any) -> List[_CheckError]: ...
|
||||||
|
|
||||||
class BaseModelAdminChecks:
|
class BaseModelAdminChecks:
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ from django.template.response import TemplateResponse
|
|||||||
from django.urls.resolvers import URLResolver
|
from django.urls.resolvers import URLResolver
|
||||||
from django.utils.functional import LazyObject
|
from django.utils.functional import LazyObject
|
||||||
|
|
||||||
|
from django.apps.config import AppConfig
|
||||||
|
|
||||||
all_sites: Any
|
all_sites: Any
|
||||||
|
|
||||||
class AlreadyRegistered(Exception): ...
|
class AlreadyRegistered(Exception): ...
|
||||||
@@ -28,7 +30,7 @@ class AdminSite:
|
|||||||
name: str = ...
|
name: str = ...
|
||||||
_registry: Dict[Type[Model], ModelAdmin]
|
_registry: Dict[Type[Model], ModelAdmin]
|
||||||
def __init__(self, name: str = ...) -> None: ...
|
def __init__(self, name: str = ...) -> None: ...
|
||||||
def check(self, app_configs: None) -> List[Any]: ...
|
def check(self, app_configs: Optional[Iterable[AppConfig]]) -> List[Any]: ...
|
||||||
def register(
|
def register(
|
||||||
self,
|
self,
|
||||||
model_or_iterable: Union[Type[Model], Iterable[Type[Model]]],
|
model_or_iterable: Union[Type[Model], Iterable[Type[Model]]],
|
||||||
@@ -37,7 +39,7 @@ class AdminSite:
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def unregister(self, model_or_iterable: Union[Type[Model], Iterable[Type[Model]]]) -> None: ...
|
def unregister(self, model_or_iterable: Union[Type[Model], Iterable[Type[Model]]]) -> None: ...
|
||||||
def is_registered(self, model: Type[Model]) -> bool: ...
|
def is_registered(self, model: Type[Model]) -> bool: ...
|
||||||
def add_action(self, action: Callable, name: None = ...) -> None: ...
|
def add_action(self, action: Callable, name: Optional[str] = ...) -> None: ...
|
||||||
def disable_action(self, name: str) -> None: ...
|
def disable_action(self, name: str) -> None: ...
|
||||||
def get_action(self, name: str) -> Callable: ...
|
def get_action(self, name: str) -> Callable: ...
|
||||||
@property
|
@property
|
||||||
@@ -52,14 +54,20 @@ class AdminSite:
|
|||||||
@property
|
@property
|
||||||
def urls(self) -> Tuple[List[URLResolver], str, str]: ...
|
def urls(self) -> Tuple[List[URLResolver], str, str]: ...
|
||||||
def each_context(self, request: Any): ...
|
def each_context(self, request: Any): ...
|
||||||
def password_change(self, request: WSGIRequest, extra_context: Dict[str, str] = ...) -> TemplateResponse: ...
|
def password_change(
|
||||||
def password_change_done(self, request: WSGIRequest, extra_context: None = ...) -> TemplateResponse: ...
|
self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...
|
||||||
|
) -> TemplateResponse: ...
|
||||||
|
def password_change_done(
|
||||||
|
self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...
|
||||||
|
) -> TemplateResponse: ...
|
||||||
def i18n_javascript(self, request: WSGIRequest, extra_context: Optional[Dict[Any, Any]] = ...) -> HttpResponse: ...
|
def i18n_javascript(self, request: WSGIRequest, extra_context: Optional[Dict[Any, Any]] = ...) -> HttpResponse: ...
|
||||||
def logout(self, request: WSGIRequest, extra_context: None = ...) -> TemplateResponse: ...
|
def logout(self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...) -> TemplateResponse: ...
|
||||||
def login(self, request: WSGIRequest, extra_context: None = ...) -> HttpResponse: ...
|
def login(self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...) -> HttpResponse: ...
|
||||||
def get_app_list(self, request: WSGIRequest) -> List[Any]: ...
|
def get_app_list(self, request: WSGIRequest) -> List[Any]: ...
|
||||||
def index(self, request: WSGIRequest, extra_context: Optional[Dict[str, str]] = ...) -> TemplateResponse: ...
|
def index(self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...) -> TemplateResponse: ...
|
||||||
def app_index(self, request: WSGIRequest, app_label: str, extra_context: None = ...) -> TemplateResponse: ...
|
def app_index(
|
||||||
|
self, request: WSGIRequest, app_label: str, extra_context: Optional[Dict[str, Any]] = ...
|
||||||
|
) -> TemplateResponse: ...
|
||||||
|
|
||||||
class DefaultAdminSite(LazyObject): ...
|
class DefaultAdminSite(LazyObject): ...
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,10 @@ from django.contrib.auth.forms import AdminPasswordChangeForm
|
|||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.deletion import Collector
|
from django.db.models.deletion import Collector
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
|
||||||
from django.db.models.fields.reverse_related import ManyToOneRel
|
from django.db.models.fields.reverse_related import ManyToOneRel
|
||||||
from django.db.models.options import Options
|
from django.db.models.options import Options
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from django.forms.forms import BaseForm
|
from django.forms.forms import BaseForm
|
||||||
from django.utils.safestring import SafeText
|
|
||||||
|
|
||||||
from django.db.models.fields import Field, reverse_related
|
from django.db.models.fields import Field, reverse_related
|
||||||
|
|
||||||
@@ -27,7 +25,7 @@ def unquote(s: str) -> str: ...
|
|||||||
def flatten(fields: Any) -> List[Union[Callable, str]]: ...
|
def flatten(fields: Any) -> List[Union[Callable, str]]: ...
|
||||||
def flatten_fieldsets(fieldsets: Any) -> List[Union[Callable, str]]: ...
|
def flatten_fieldsets(fieldsets: Any) -> List[Union[Callable, str]]: ...
|
||||||
def get_deleted_objects(
|
def get_deleted_objects(
|
||||||
objs: QuerySet, request: WSGIRequest, admin_site: AdminSite
|
objs: Sequence[Optional[Model]], request: WSGIRequest, admin_site: AdminSite
|
||||||
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
||||||
|
|
||||||
class NestedObjects(Collector):
|
class NestedObjects(Collector):
|
||||||
@@ -41,22 +39,14 @@ class NestedObjects(Collector):
|
|||||||
model_objs: Any = ...
|
model_objs: Any = ...
|
||||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||||
def add_edge(self, source: Optional[Model], target: Model) -> None: ...
|
def add_edge(self, source: Optional[Model], target: Model) -> None: ...
|
||||||
def collect(
|
def related_objects(self, related: ManyToOneRel, objs: Sequence[Optional[Model]]) -> QuerySet: ...
|
||||||
self,
|
def nested(self, format_callback: Callable = ...) -> List[Any]: ...
|
||||||
objs: Union[Sequence[Optional[Model]], QuerySet],
|
|
||||||
source: Optional[Type[Model]] = ...,
|
|
||||||
source_attr: Optional[str] = ...,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
def related_objects(self, related: ManyToOneRel, objs: List[Model]) -> QuerySet: ...
|
|
||||||
def nested(self, format_callback: Callable = ...) -> Union[List[SafeText], List[int]]: ...
|
|
||||||
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ...
|
|
||||||
|
|
||||||
def model_format_dict(obj: Any): ...
|
def model_format_dict(obj: Any): ...
|
||||||
def model_ngettext(obj: Union[Options, QuerySet], n: Optional[int] = ...) -> str: ...
|
def model_ngettext(obj: Union[Options, QuerySet], n: Optional[int] = ...) -> str: ...
|
||||||
def lookup_field(
|
def lookup_field(
|
||||||
name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ...
|
name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ...
|
||||||
) -> Tuple[Optional[Field], Callable, Callable]: ...
|
) -> Tuple[Optional[Field], Any, Any]: ...
|
||||||
def label_for_field(
|
def label_for_field(
|
||||||
name: Union[Callable, str],
|
name: Union[Callable, str],
|
||||||
model: Type[Model],
|
model: Type[Model],
|
||||||
@@ -65,16 +55,14 @@ def label_for_field(
|
|||||||
form: Optional[BaseForm] = ...,
|
form: Optional[BaseForm] = ...,
|
||||||
) -> Union[Tuple[Optional[str], Union[Callable, Type[str]]], str]: ...
|
) -> Union[Tuple[Optional[str], Union[Callable, Type[str]]], str]: ...
|
||||||
def help_text_for_field(name: str, model: Type[Model]) -> str: ...
|
def help_text_for_field(name: str, model: Type[Model]) -> str: ...
|
||||||
def display_for_field(
|
def display_for_field(value: Any, field: Field, empty_value_display: str) -> str: ...
|
||||||
value: Any, field: Union[Field, reverse_related.OneToOneRel], empty_value_display: str
|
|
||||||
) -> str: ...
|
|
||||||
def display_for_value(value: Any, empty_value_display: str, boolean: bool = ...) -> str: ...
|
def display_for_value(value: Any, empty_value_display: str, boolean: bool = ...) -> str: ...
|
||||||
|
|
||||||
class NotRelationField(Exception): ...
|
class NotRelationField(Exception): ...
|
||||||
|
|
||||||
def get_model_from_relation(field: Union[Field, reverse_related.ForeignObjectRel]) -> Type[Model]: ...
|
def get_model_from_relation(field: Union[Field, reverse_related.ForeignObjectRel]) -> Type[Model]: ...
|
||||||
def reverse_field_path(model: Type[Model], path: str) -> Tuple[Type[Model], str]: ...
|
def reverse_field_path(model: Type[Model], path: str) -> Tuple[Type[Model], str]: ...
|
||||||
def get_fields_from_path(model: Type[Model], path: str) -> List[Union[Field, FieldCacheMixin]]: ...
|
def get_fields_from_path(model: Type[Model], path: str) -> List[Field]: ...
|
||||||
def construct_change_message(
|
def construct_change_message(
|
||||||
form: AdminPasswordChangeForm, formsets: None, add: bool
|
form: AdminPasswordChangeForm, formsets: None, add: bool
|
||||||
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||||
|
|||||||
@@ -13,11 +13,10 @@ class BaseUserManager(models.Manager[_T]):
|
|||||||
def get_by_natural_key(self, username: Optional[str]) -> _T: ...
|
def get_by_natural_key(self, username: Optional[str]) -> _T: ...
|
||||||
|
|
||||||
class AbstractBaseUser(models.Model):
|
class AbstractBaseUser(models.Model):
|
||||||
|
REQUIRED_FIELDS: List[str] = ...
|
||||||
|
|
||||||
password = models.CharField(max_length=128)
|
password = models.CharField(max_length=128)
|
||||||
last_login = models.DateTimeField(blank=True, null=True)
|
last_login = models.DateTimeField(blank=True, null=True)
|
||||||
|
|
||||||
REQUIRED_FIELDS: List[str] = ...
|
|
||||||
class Meta: ...
|
|
||||||
def get_username(self) -> str: ...
|
def get_username(self) -> str: ...
|
||||||
def natural_key(self) -> Tuple[str]: ...
|
def natural_key(self) -> Tuple[str]: ...
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List, Iterable, Optional
|
||||||
|
|
||||||
from django.core.checks.messages import CheckMessage
|
from django.core.checks.messages import CheckMessage
|
||||||
|
|
||||||
def check_user_model(app_configs: None = ..., **kwargs: Any) -> List[CheckMessage]: ...
|
from django.apps.config import AppConfig
|
||||||
def check_models_permissions(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
|
||||||
|
def check_user_model(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[CheckMessage]: ...
|
||||||
|
def check_models_permissions(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ...
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List, Iterable, Optional
|
||||||
|
|
||||||
def check_generic_foreign_keys(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
from django.apps.config import AppConfig
|
||||||
def check_model_name_lengths(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
|
||||||
|
def check_generic_foreign_keys(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ...
|
||||||
|
def check_model_name_lengths(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ...
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from django.apps.config import AppConfig
|
||||||
from django.apps.registry import Apps
|
from django.apps.registry import Apps
|
||||||
from django.contrib.sites.apps import SitesConfig
|
|
||||||
|
|
||||||
def create_default_site(
|
def create_default_site(
|
||||||
app_config: SitesConfig,
|
app_config: AppConfig,
|
||||||
verbosity: int = ...,
|
verbosity: int = ...,
|
||||||
interactive: bool = ...,
|
interactive: bool = ...,
|
||||||
using: str = ...,
|
using: str = ...,
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List, Iterable, Optional
|
||||||
|
|
||||||
from django.core.checks.messages import Error
|
from django.core.checks.messages import Error
|
||||||
|
|
||||||
def check_finders(app_configs: None = ..., **kwargs: Any) -> List[Error]: ...
|
from django.apps.config import AppConfig
|
||||||
|
|
||||||
|
def check_finders(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Error]: ...
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List, Iterable, Optional
|
||||||
|
|
||||||
from django.core.checks.messages import Error
|
from django.core.checks.messages import Error
|
||||||
|
|
||||||
|
from django.apps.config import AppConfig
|
||||||
|
|
||||||
E001: Any
|
E001: Any
|
||||||
|
|
||||||
def check_default_cache_is_configured(app_configs: None, **kwargs: Any) -> List[Error]: ...
|
def check_default_cache_is_configured(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ...
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List, Iterable, Optional
|
||||||
|
|
||||||
from django.core.checks.messages import Warning
|
from django.core.checks.messages import Warning
|
||||||
|
|
||||||
def check_all_models(app_configs: None = ..., **kwargs: Any) -> List[Warning]: ...
|
from django.apps.config import AppConfig
|
||||||
def check_lazy_references(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
|
||||||
|
def check_all_models(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Warning]: ...
|
||||||
|
def check_lazy_references(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ...
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List, Iterable, Optional
|
||||||
|
|
||||||
from django.core.checks.messages import Warning
|
from django.core.checks.messages import Warning
|
||||||
|
|
||||||
|
from django.apps.config import AppConfig
|
||||||
|
|
||||||
SECRET_KEY_MIN_LENGTH: int
|
SECRET_KEY_MIN_LENGTH: int
|
||||||
SECRET_KEY_MIN_UNIQUE_CHARACTERS: int
|
SECRET_KEY_MIN_UNIQUE_CHARACTERS: int
|
||||||
W001: Any
|
W001: Any
|
||||||
@@ -17,15 +19,15 @@ W019: Any
|
|||||||
W020: Any
|
W020: Any
|
||||||
W021: Any
|
W021: Any
|
||||||
|
|
||||||
def check_security_middleware(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_security_middleware(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_xframe_options_middleware(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_xframe_options_middleware(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_sts(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_sts(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_sts_include_subdomains(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_sts_include_subdomains(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_sts_preload(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_sts_preload(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_content_type_nosniff(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_content_type_nosniff(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_xss_filter(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_xss_filter(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_ssl_redirect(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_ssl_redirect(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_secret_key(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_secret_key(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_debug(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_debug(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_xframe_deny(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_xframe_deny(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_allowed_hosts(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_allowed_hosts(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List, Iterable, Optional
|
||||||
|
|
||||||
from django.core.checks.messages import Warning
|
from django.core.checks.messages import Warning
|
||||||
|
|
||||||
|
from django.apps.config import AppConfig
|
||||||
|
|
||||||
W003: Any
|
W003: Any
|
||||||
W016: Any
|
W016: Any
|
||||||
|
|
||||||
def check_csrf_middleware(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_csrf_middleware(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_csrf_cookie_secure(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_csrf_cookie_secure(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List, Iterable, Optional
|
||||||
|
|
||||||
from django.core.checks.messages import Warning
|
from django.core.checks.messages import Warning
|
||||||
|
|
||||||
|
from django.apps.config import AppConfig
|
||||||
|
|
||||||
def add_session_cookie_message(message: Any): ...
|
def add_session_cookie_message(message: Any): ...
|
||||||
|
|
||||||
W010: Any
|
W010: Any
|
||||||
@@ -14,5 +16,5 @@ W013: Any
|
|||||||
W014: Any
|
W014: Any
|
||||||
W015: Any
|
W015: Any
|
||||||
|
|
||||||
def check_session_cookie_secure(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_session_cookie_secure(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def check_session_cookie_httponly(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_session_cookie_httponly(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List, Iterable, Optional
|
||||||
|
|
||||||
from django.core.checks.messages import Error
|
from django.core.checks.messages import Error
|
||||||
|
|
||||||
|
from django.apps.config import AppConfig
|
||||||
|
|
||||||
E001: Any
|
E001: Any
|
||||||
E002: Any
|
E002: Any
|
||||||
|
|
||||||
def check_setting_app_dirs_loaders(app_configs: None, **kwargs: Any) -> List[Error]: ...
|
def check_setting_app_dirs_loaders(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ...
|
||||||
def check_string_if_invalid_is_string(app_configs: None, **kwargs: Any) -> List[Error]: ...
|
def check_string_if_invalid_is_string(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ...
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
from typing import Any, Callable, List, Tuple, Union
|
from typing import Any, Callable, List, Tuple, Union, Iterable, Optional
|
||||||
|
|
||||||
from django.core.checks.messages import CheckMessage, Error, Warning
|
from django.core.checks.messages import CheckMessage, Error, Warning
|
||||||
from django.urls.resolvers import URLPattern, URLResolver
|
from django.urls.resolvers import URLPattern, URLResolver
|
||||||
|
|
||||||
def check_url_config(app_configs: None, **kwargs: Any) -> List[CheckMessage]: ...
|
from django.apps.config import AppConfig
|
||||||
|
|
||||||
|
def check_url_config(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[CheckMessage]: ...
|
||||||
def check_resolver(resolver: Union[Tuple[str, Callable], URLPattern, URLResolver]) -> List[CheckMessage]: ...
|
def check_resolver(resolver: Union[Tuple[str, Callable], URLPattern, URLResolver]) -> List[CheckMessage]: ...
|
||||||
def check_url_namespaces_unique(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
def check_url_namespaces_unique(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||||
def get_warning_for_invalid_pattern(pattern: Any) -> List[Error]: ...
|
def get_warning_for_invalid_pattern(pattern: Any) -> List[Error]: ...
|
||||||
def check_url_settings(app_configs: None, **kwargs: Any) -> List[Error]: ...
|
def check_url_settings(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ...
|
||||||
def E006(name: str) -> Error: ...
|
def E006(name: str) -> Error: ...
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from datetime import date
|
from datetime import date
|
||||||
from io import BufferedReader, StringIO, TextIOWrapper
|
from io import BufferedReader, StringIO, TextIOWrapper
|
||||||
from typing import Any, Dict, Iterable, List, Mapping, Optional, Type, Union
|
from typing import Any, Dict, Iterable, List, Mapping, Optional, Type, Union, Collection
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.core.management.base import OutputWrapper
|
from django.core.management.base import OutputWrapper
|
||||||
@@ -35,18 +35,18 @@ class Serializer:
|
|||||||
internal_use_only: bool = ...
|
internal_use_only: bool = ...
|
||||||
progress_class: Any = ...
|
progress_class: Any = ...
|
||||||
stream_class: Any = ...
|
stream_class: Any = ...
|
||||||
options: Any = ...
|
options: Dict[str, Any] = ...
|
||||||
stream: Any = ...
|
stream: Any = ...
|
||||||
selected_fields: Any = ...
|
selected_fields: Optional[Collection[str]] = ...
|
||||||
use_natural_foreign_keys: Any = ...
|
use_natural_foreign_keys: bool = ...
|
||||||
use_natural_primary_keys: Any = ...
|
use_natural_primary_keys: bool = ...
|
||||||
first: bool = ...
|
first: bool = ...
|
||||||
def serialize(
|
def serialize(
|
||||||
self,
|
self,
|
||||||
queryset: Iterable[Model],
|
queryset: Iterable[Model],
|
||||||
*,
|
*,
|
||||||
stream: Optional[Any] = ...,
|
stream: Optional[Any] = ...,
|
||||||
fields: Optional[Any] = ...,
|
fields: Optional[Collection[str]] = ...,
|
||||||
use_natural_foreign_keys: bool = ...,
|
use_natural_foreign_keys: bool = ...,
|
||||||
use_natural_primary_keys: bool = ...,
|
use_natural_primary_keys: bool = ...,
|
||||||
progress_output: Optional[Any] = ...,
|
progress_output: Optional[Any] = ...,
|
||||||
@@ -63,7 +63,7 @@ class Serializer:
|
|||||||
def getvalue(self) -> Optional[Union[bytes, str]]: ...
|
def getvalue(self) -> Optional[Union[bytes, str]]: ...
|
||||||
|
|
||||||
class Deserializer:
|
class Deserializer:
|
||||||
options: Any = ...
|
options: Dict[str, Any] = ...
|
||||||
stream: Any = ...
|
stream: Any = ...
|
||||||
def __init__(self, stream_or_string: Union[BufferedReader, TextIOWrapper, str], **options: Any) -> None: ...
|
def __init__(self, stream_or_string: Union[BufferedReader, TextIOWrapper, str], **options: Any) -> None: ...
|
||||||
def __iter__(self) -> Deserializer: ...
|
def __iter__(self) -> Deserializer: ...
|
||||||
|
|||||||
@@ -1,24 +1,10 @@
|
|||||||
import json
|
import json
|
||||||
from datetime import datetime
|
from typing import Any, Dict
|
||||||
from decimal import Decimal
|
|
||||||
from io import TextIOWrapper
|
|
||||||
from typing import Any, Union, Dict
|
|
||||||
from uuid import UUID
|
|
||||||
|
|
||||||
from django.core.serializers.python import Serializer as PythonSerializer
|
from django.core.serializers.python import Serializer as PythonSerializer
|
||||||
from django.db.models.base import Model
|
|
||||||
|
|
||||||
class Serializer(PythonSerializer):
|
class Serializer(PythonSerializer):
|
||||||
json_kwargs: Dict[str, Any]
|
json_kwargs: Dict[str, Any]
|
||||||
options: Dict[str, None]
|
|
||||||
selected_fields: None
|
|
||||||
stream: TextIOWrapper
|
|
||||||
use_natural_foreign_keys: bool
|
|
||||||
use_natural_primary_keys: bool
|
|
||||||
internal_use_only: bool = ...
|
|
||||||
def start_serialization(self) -> None: ...
|
|
||||||
def end_serialization(self) -> None: ...
|
|
||||||
def end_object(self, obj: Model) -> None: ...
|
|
||||||
|
|
||||||
def Deserializer(stream_or_string: Any, **options: Any) -> None: ...
|
def Deserializer(stream_or_string: Any, **options: Any) -> None: ...
|
||||||
|
|
||||||
@@ -29,4 +15,3 @@ class DjangoJSONEncoder(json.JSONEncoder):
|
|||||||
indent: int
|
indent: int
|
||||||
skipkeys: bool
|
skipkeys: bool
|
||||||
sort_keys: bool
|
sort_keys: bool
|
||||||
def default(self, o: Union[datetime, Decimal, UUID]) -> str: ...
|
|
||||||
|
|||||||
@@ -1,31 +1,15 @@
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from io import TextIOWrapper
|
from typing import Any, Dict, Iterator, List, Optional
|
||||||
from typing import Any, Dict, Iterator, List
|
|
||||||
|
|
||||||
from django.core.serializers.base import DeserializedObject
|
from django.core.serializers.base import DeserializedObject
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.fields.related import ForeignKey, ManyToManyField
|
|
||||||
|
|
||||||
from django.core.serializers import base
|
from django.core.serializers import base
|
||||||
from django.db.models.fields import Field
|
|
||||||
|
|
||||||
class Serializer(base.Serializer):
|
class Serializer(base.Serializer):
|
||||||
options: Dict[Any, Any]
|
|
||||||
selected_fields: None
|
|
||||||
stream: TextIOWrapper
|
|
||||||
use_natural_foreign_keys: bool
|
|
||||||
use_natural_primary_keys: bool
|
|
||||||
internal_use_only: bool = ...
|
|
||||||
objects: List[Any] = ...
|
objects: List[Any] = ...
|
||||||
def start_serialization(self) -> None: ...
|
|
||||||
def end_serialization(self) -> None: ...
|
|
||||||
def start_object(self, obj: Model) -> None: ...
|
|
||||||
def end_object(self, obj: Model) -> None: ...
|
|
||||||
def get_dump_object(self, obj: Model) -> OrderedDict: ...
|
def get_dump_object(self, obj: Model) -> OrderedDict: ...
|
||||||
def handle_field(self, obj: Model, field: Field) -> None: ...
|
|
||||||
def handle_fk_field(self, obj: Model, field: ForeignKey) -> None: ...
|
|
||||||
def handle_m2m_field(self, obj: Model, field: ManyToManyField) -> None: ...
|
|
||||||
|
|
||||||
def Deserializer(
|
def Deserializer(
|
||||||
object_list: List[Dict[str, Any]], *, using: Any = ..., ignorenonexistent: bool = ..., **options: Any
|
object_list: List[Dict[str, Any]], *, using: Optional[str] = ..., ignorenonexistent: bool = ..., **options: Any
|
||||||
) -> Iterator[DeserializedObject]: ...
|
) -> Iterator[DeserializedObject]: ...
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
from datetime import datetime
|
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from re import RegexFlag
|
from re import RegexFlag
|
||||||
from typing import Any, Dict, List, Optional, Union, Pattern, Collection
|
from typing import Any, Dict, List, Optional, Union, Pattern, Collection, Callable, Tuple
|
||||||
from uuid import UUID
|
|
||||||
|
|
||||||
from django.core.files.base import File
|
from django.core.files.base import File
|
||||||
from django.core.exceptions import ValidationError as ValidationError # noqa: F401
|
|
||||||
|
|
||||||
EMPTY_VALUES: Any
|
EMPTY_VALUES: Any
|
||||||
|
|
||||||
_Regex = Union[str, Pattern[str]]
|
_Regex = Union[str, Pattern[str]]
|
||||||
|
_ErrorMessage = Union[str, Any]
|
||||||
|
|
||||||
def _lazy_re_compile(regex: _Regex, flags: int = ...): ...
|
def _lazy_re_compile(regex: _Regex, flags: int = ...): ...
|
||||||
|
|
||||||
@@ -22,7 +20,7 @@ class RegexValidator:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
regex: Optional[_Regex] = ...,
|
regex: Optional[_Regex] = ...,
|
||||||
message: Optional[str] = ...,
|
message: Optional[_ErrorMessage] = ...,
|
||||||
code: Optional[str] = ...,
|
code: Optional[str] = ...,
|
||||||
inverse_match: Optional[bool] = ...,
|
inverse_match: Optional[bool] = ...,
|
||||||
flags: Optional[RegexFlag] = ...,
|
flags: Optional[RegexFlag] = ...,
|
||||||
@@ -45,67 +43,53 @@ integer_validator: Any
|
|||||||
def validate_integer(value: Optional[Union[float, str]]) -> None: ...
|
def validate_integer(value: Optional[Union[float, str]]) -> None: ...
|
||||||
|
|
||||||
class EmailValidator:
|
class EmailValidator:
|
||||||
message: Any = ...
|
message: str = ...
|
||||||
code: str = ...
|
code: str = ...
|
||||||
user_regex: Any = ...
|
user_regex: Any = ...
|
||||||
domain_regex: Any = ...
|
domain_regex: Any = ...
|
||||||
literal_regex: Any = ...
|
literal_regex: Any = ...
|
||||||
domain_whitelist: Any = ...
|
domain_whitelist: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self, message: Optional[str] = ..., code: Optional[str] = ..., whitelist: Optional[Collection[str]] = ...
|
self,
|
||||||
|
message: Optional[_ErrorMessage] = ...,
|
||||||
|
code: Optional[str] = ...,
|
||||||
|
whitelist: Optional[Collection[str]] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __call__(self, value: Optional[str]) -> None: ...
|
def __call__(self, value: Optional[str]) -> None: ...
|
||||||
def validate_domain_part(self, domain_part: str) -> bool: ...
|
def validate_domain_part(self, domain_part: str) -> bool: ...
|
||||||
|
|
||||||
validate_email: Any
|
validate_email: EmailValidator = ...
|
||||||
slug_re: Any
|
slug_re: Pattern = ...
|
||||||
validate_slug: Any
|
validate_slug: RegexValidator = ...
|
||||||
slug_unicode_re: Any
|
slug_unicode_re: Pattern = ...
|
||||||
validate_unicode_slug: Any
|
validate_unicode_slug: RegexValidator = ...
|
||||||
|
|
||||||
def validate_ipv4_address(value: str) -> None: ...
|
def validate_ipv4_address(value: str) -> None: ...
|
||||||
def validate_ipv6_address(value: str) -> None: ...
|
def validate_ipv6_address(value: str) -> None: ...
|
||||||
def validate_ipv46_address(value: str) -> None: ...
|
def validate_ipv46_address(value: str) -> None: ...
|
||||||
|
|
||||||
ip_address_validator_map: Any
|
ip_address_validator_map: Dict[str, Tuple[Callable[[Any], None], str]]
|
||||||
|
|
||||||
def ip_address_validators(protocol: str, unpack_ipv4: bool) -> Any: ...
|
def ip_address_validators(protocol: str, unpack_ipv4: bool) -> Any: ...
|
||||||
def int_list_validator(
|
def int_list_validator(
|
||||||
sep: str = ..., message: None = ..., code: str = ..., allow_negative: bool = ...
|
sep: str = ..., message: Optional[_ErrorMessage] = ..., code: str = ..., allow_negative: bool = ...
|
||||||
) -> RegexValidator: ...
|
) -> RegexValidator: ...
|
||||||
|
|
||||||
validate_comma_separated_integer_list: Any
|
validate_comma_separated_integer_list: Any
|
||||||
|
|
||||||
class BaseValidator:
|
class BaseValidator:
|
||||||
message: Any = ...
|
message: str = ...
|
||||||
code: str = ...
|
code: str = ...
|
||||||
limit_value: Any = ...
|
limit_value: Any = ...
|
||||||
def __init__(self, limit_value: Any, message: Optional[str] = ...) -> None: ...
|
def __init__(self, limit_value: Any, message: Optional[_ErrorMessage] = ...) -> None: ...
|
||||||
def __call__(self, value: Any) -> None: ...
|
def __call__(self, value: Any) -> None: ...
|
||||||
def compare(self, a: bool, b: bool) -> bool: ...
|
def compare(self, a: Any, b: Any) -> bool: ...
|
||||||
def clean(self, x: Any) -> Any: ...
|
def clean(self, x: Any) -> Any: ...
|
||||||
|
|
||||||
class MaxValueValidator(BaseValidator):
|
class MaxValueValidator(BaseValidator): ...
|
||||||
message: Any = ...
|
class MinValueValidator(BaseValidator): ...
|
||||||
code: str = ...
|
class MinLengthValidator(BaseValidator): ...
|
||||||
def compare(self, a: Union[datetime, Decimal, float], b: Union[datetime, Decimal, float]) -> bool: ...
|
class MaxLengthValidator(BaseValidator): ...
|
||||||
|
|
||||||
class MinValueValidator(BaseValidator):
|
|
||||||
message: Any = ...
|
|
||||||
code: str = ...
|
|
||||||
def compare(self, a: Union[datetime, Decimal, float], b: Union[datetime, Decimal, float]) -> bool: ...
|
|
||||||
|
|
||||||
class MinLengthValidator(BaseValidator):
|
|
||||||
message: Any = ...
|
|
||||||
code: str = ...
|
|
||||||
def compare(self, a: int, b: int) -> bool: ...
|
|
||||||
def clean(self, x: str) -> int: ...
|
|
||||||
|
|
||||||
class MaxLengthValidator(BaseValidator):
|
|
||||||
message: Any = ...
|
|
||||||
code: str = ...
|
|
||||||
def compare(self, a: int, b: int) -> bool: ...
|
|
||||||
def clean(self, x: Union[bytes, str]) -> int: ...
|
|
||||||
|
|
||||||
class DecimalValidator:
|
class DecimalValidator:
|
||||||
messages: Any = ...
|
messages: Any = ...
|
||||||
@@ -115,13 +99,13 @@ class DecimalValidator:
|
|||||||
def __call__(self, value: Decimal) -> None: ...
|
def __call__(self, value: Decimal) -> None: ...
|
||||||
|
|
||||||
class FileExtensionValidator:
|
class FileExtensionValidator:
|
||||||
message: Any = ...
|
message: str = ...
|
||||||
code: str = ...
|
code: str = ...
|
||||||
allowed_extensions: List[str] = ...
|
allowed_extensions: List[str] = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
allowed_extensions: Optional[Collection[str]] = ...,
|
allowed_extensions: Optional[Collection[str]] = ...,
|
||||||
message: Optional[str] = ...,
|
message: Optional[_ErrorMessage] = ...,
|
||||||
code: Optional[str] = ...,
|
code: Optional[str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __call__(self, value: File) -> None: ...
|
def __call__(self, value: File) -> None: ...
|
||||||
@@ -130,7 +114,7 @@ def get_available_image_extensions() -> List[str]: ...
|
|||||||
def validate_image_file_extension(value: File) -> None: ...
|
def validate_image_file_extension(value: File) -> None: ...
|
||||||
|
|
||||||
class ProhibitNullCharactersValidator:
|
class ProhibitNullCharactersValidator:
|
||||||
message: Any = ...
|
message: str = ...
|
||||||
code: str = ...
|
code: str = ...
|
||||||
def __init__(self, message: Optional[str] = ..., code: Optional[str] = ...) -> None: ...
|
def __init__(self, message: Optional[_ErrorMessage] = ..., code: Optional[str] = ...) -> None: ...
|
||||||
def __call__(self, value: Optional[Union[Dict[Any, Any], str, UUID]]) -> None: ...
|
def __call__(self, value: Any) -> None: ...
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from typing import Any, Callable, Iterable, Optional, Union
|
from typing import Any, Callable, Iterable, Optional, Union, Collection, Type
|
||||||
|
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
|
|
||||||
@@ -18,4 +18,11 @@ class ProtectedError(IntegrityError): ...
|
|||||||
|
|
||||||
class Collector:
|
class Collector:
|
||||||
def __init__(self, using: str) -> None: ...
|
def __init__(self, using: str) -> None: ...
|
||||||
|
def collect(
|
||||||
|
self,
|
||||||
|
objs: Collection[Optional[Model]],
|
||||||
|
source: Optional[Type[Model]] = ...,
|
||||||
|
source_attr: Optional[str] = ...,
|
||||||
|
**kwargs: Any
|
||||||
|
) -> None: ...
|
||||||
def can_fast_delete(self, objs: Union[Model, Iterable[Model]], from_field: Optional[Field] = ...) -> bool: ...
|
def can_fast_delete(self, objs: Union[Model, Iterable[Model]], from_field: Optional[Field] = ...) -> bool: ...
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ from typing import (
|
|||||||
TypeVar,
|
TypeVar,
|
||||||
Union,
|
Union,
|
||||||
overload,
|
overload,
|
||||||
|
Reversible,
|
||||||
)
|
)
|
||||||
|
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
@@ -121,13 +122,14 @@ class _BaseQuerySet(Generic[_T], Sized):
|
|||||||
def db(self) -> str: ...
|
def db(self) -> str: ...
|
||||||
def resolve_expression(self, *args: Any, **kwargs: Any) -> Any: ...
|
def resolve_expression(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||||
|
|
||||||
class QuerySet(_BaseQuerySet[_T], Collection[_T], Sized):
|
class QuerySet(_BaseQuerySet[_T], Collection[_T], Reversible[_T], Sized):
|
||||||
def __iter__(self) -> Iterator[_T]: ...
|
def __iter__(self) -> Iterator[_T]: ...
|
||||||
def __contains__(self, x: object) -> bool: ...
|
def __contains__(self, x: object) -> bool: ...
|
||||||
@overload
|
@overload
|
||||||
def __getitem__(self, i: int) -> _T: ...
|
def __getitem__(self, i: int) -> _T: ...
|
||||||
@overload
|
@overload
|
||||||
def __getitem__(self: _QS, s: slice) -> _QS: ...
|
def __getitem__(self: _QS, s: slice) -> _QS: ...
|
||||||
|
def __reversed__(self) -> Iterator[_T]: ...
|
||||||
|
|
||||||
_Row = TypeVar("_Row", covariant=True)
|
_Row = TypeVar("_Row", covariant=True)
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ from typing import (
|
|||||||
|
|
||||||
from django.contrib.auth.base_user import AbstractBaseUser
|
from django.contrib.auth.base_user import AbstractBaseUser
|
||||||
from django.contrib.sessions.backends.base import SessionBase
|
from django.contrib.sessions.backends.base import SessionBase
|
||||||
|
from django.contrib.sites.models import Site
|
||||||
from django.utils.datastructures import CaseInsensitiveMapping, ImmutableList, MultiValueDict
|
from django.utils.datastructures import CaseInsensitiveMapping, ImmutableList, MultiValueDict
|
||||||
|
|
||||||
from django.core.files import uploadedfile, uploadhandler
|
from django.core.files import uploadedfile, uploadhandler
|
||||||
@@ -51,6 +52,7 @@ class HttpRequest(BytesIO):
|
|||||||
content_type: Optional[str] = ...
|
content_type: Optional[str] = ...
|
||||||
content_params: Optional[Dict[str, str]] = ...
|
content_params: Optional[Dict[str, str]] = ...
|
||||||
user: AbstractBaseUser
|
user: AbstractBaseUser
|
||||||
|
site: Site
|
||||||
session: SessionBase
|
session: SessionBase
|
||||||
encoding: Optional[str] = ...
|
encoding: Optional[str] = ...
|
||||||
upload_handlers: UploadHandlerList = ...
|
upload_handlers: UploadHandlerList = ...
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ class HttpResponseBase(Iterable[Any]):
|
|||||||
class HttpResponse(HttpResponseBase):
|
class HttpResponse(HttpResponseBase):
|
||||||
client: Client
|
client: Client
|
||||||
context: Context
|
context: Context
|
||||||
|
content: Any
|
||||||
csrf_cookie_set: bool
|
csrf_cookie_set: bool
|
||||||
redirect_chain: List[Tuple[str, int]]
|
redirect_chain: List[Tuple[str, int]]
|
||||||
request: Dict[str, Any]
|
request: Dict[str, Any]
|
||||||
@@ -78,10 +79,6 @@ class HttpResponse(HttpResponseBase):
|
|||||||
def __init__(self, content: object = ..., *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, content: object = ..., *args: Any, **kwargs: Any) -> None: ...
|
||||||
def serialize(self) -> bytes: ...
|
def serialize(self) -> bytes: ...
|
||||||
@property
|
@property
|
||||||
def content(self) -> Any: ...
|
|
||||||
@content.setter
|
|
||||||
def content(self, value: Any) -> None: ...
|
|
||||||
@property
|
|
||||||
def url(self) -> str: ...
|
def url(self) -> str: ...
|
||||||
def json(self) -> Dict[str, Any]: ...
|
def json(self) -> Dict[str, Any]: ...
|
||||||
|
|
||||||
@@ -107,7 +104,7 @@ class FileResponse(StreamingHttpResponse):
|
|||||||
def json(self) -> Dict[str, Any]: ...
|
def json(self) -> Dict[str, Any]: ...
|
||||||
|
|
||||||
class HttpResponseRedirectBase(HttpResponse):
|
class HttpResponseRedirectBase(HttpResponse):
|
||||||
allowed_schemes = ... # type: List[str]
|
allowed_schemes: List[str] = ...
|
||||||
def __init__(self, redirect_to: str, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, redirect_to: str, *args: Any, **kwargs: Any) -> None: ...
|
||||||
|
|
||||||
class HttpResponseRedirect(HttpResponseRedirectBase): ...
|
class HttpResponseRedirect(HttpResponseRedirectBase): ...
|
||||||
|
|||||||
@@ -13,28 +13,28 @@ _P = TypeVar("_P", bound=Promise)
|
|||||||
_S = TypeVar("_S", bound=str)
|
_S = TypeVar("_S", bound=str)
|
||||||
_PT = TypeVar("_PT", None, int, float, Decimal, datetime.datetime, datetime.date, datetime.time)
|
_PT = TypeVar("_PT", None, int, float, Decimal, datetime.datetime, datetime.date, datetime.time)
|
||||||
@overload
|
@overload
|
||||||
def smart_text(s: _P, encoding: str = ..., strings_only: bool = ..., errors: str = ...,) -> _P: ...
|
def smart_text(s: _P, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _P: ...
|
||||||
@overload
|
@overload
|
||||||
def smart_text(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...,) -> _PT: ...
|
def smart_text(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ...
|
||||||
@overload
|
@overload
|
||||||
def smart_text(s: _S, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _S: ...
|
def smart_text(s: _S, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _S: ...
|
||||||
@overload
|
@overload
|
||||||
def smart_text(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> str: ...
|
def smart_text(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> str: ...
|
||||||
def is_protected_type(obj: Any) -> bool: ...
|
def is_protected_type(obj: Any) -> bool: ...
|
||||||
@overload
|
@overload
|
||||||
def force_text(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...,) -> _PT: ...
|
def force_text(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ...
|
||||||
@overload
|
@overload
|
||||||
def force_text(s: _S, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _S: ...
|
def force_text(s: _S, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _S: ...
|
||||||
@overload
|
@overload
|
||||||
def force_text(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> str: ...
|
def force_text(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> str: ...
|
||||||
@overload
|
@overload
|
||||||
def smart_bytes(s: _P, encoding: str = ..., strings_only: bool = ..., errors: str = ...,) -> _P: ...
|
def smart_bytes(s: _P, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _P: ...
|
||||||
@overload
|
@overload
|
||||||
def smart_bytes(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...,) -> _PT: ...
|
def smart_bytes(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ...
|
||||||
@overload
|
@overload
|
||||||
def smart_bytes(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> bytes: ...
|
def smart_bytes(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> bytes: ...
|
||||||
@overload
|
@overload
|
||||||
def force_bytes(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...,) -> _PT: ...
|
def force_bytes(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ...
|
||||||
@overload
|
@overload
|
||||||
def force_bytes(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> bytes: ...
|
def force_bytes(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> bytes: ...
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Node:
|
|||||||
connector: str = ...
|
connector: str = ...
|
||||||
negated: bool = ...
|
negated: bool = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self, children: Optional[_NodeChildren] = ..., connector: Optional[str] = ..., negated: bool = ...,
|
self, children: Optional[_NodeChildren] = ..., connector: Optional[str] = ..., negated: bool = ...
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __deepcopy__(self, memodict: Dict[Any, Any]) -> Node: ...
|
def __deepcopy__(self, memodict: Dict[Any, Any]) -> Node: ...
|
||||||
def __len__(self) -> int: ...
|
def __len__(self) -> int: ...
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ import re
|
|||||||
|
|
||||||
IGNORED_MODULES = {'schema', 'gis_tests', 'admin_widgets', 'admin_filters',
|
IGNORED_MODULES = {'schema', 'gis_tests', 'admin_widgets', 'admin_filters',
|
||||||
'sitemaps_tests', 'staticfiles_tests', 'modeladmin', 'model_forms',
|
'sitemaps_tests', 'staticfiles_tests', 'modeladmin', 'model_forms',
|
||||||
'generic_views', 'forms_tests', 'flatpages_tests', 'admin_utils',
|
'generic_views', 'forms_tests', 'flatpages_tests',
|
||||||
'admin_ordering', 'admin_changelist', 'admin_views',
|
'admin_ordering', 'admin_changelist', 'admin_views',
|
||||||
'invalid_models_tests', 'i18n', 'model_formsets',
|
'invalid_models_tests', 'i18n', 'model_formsets',
|
||||||
'template_tests', 'template_backends', 'test_runner', 'admin_scripts',
|
'template_tests', 'template_backends', 'test_runner', 'admin_scripts',
|
||||||
'sites_tests', 'inline_formsets', 'foreign_object', 'cache'}
|
'inline_formsets', 'foreign_object', 'cache'}
|
||||||
|
|
||||||
MOCK_OBJECTS = ['MockRequest', 'MockCompiler', 'modelz', 'call_count', 'call_args_list',
|
MOCK_OBJECTS = ['MockRequest', 'MockCompiler', 'MockModelAdmin', 'modelz', 'call_count', 'call_args_list',
|
||||||
'call_args', 'MockUser', 'Xtemplate', 'DummyRequest', 'DummyUser', 'MinimalUser', 'DummyNode']
|
'call_args', 'MockUser', 'Xtemplate', 'DummyRequest', 'DummyUser', 'MinimalUser', 'DummyNode']
|
||||||
EXTERNAL_MODULES = ['psycopg2', 'PIL', 'selenium', 'oracle', 'mysql', 'sqlparse', 'tblib', 'numpy',
|
EXTERNAL_MODULES = ['psycopg2', 'PIL', 'selenium', 'oracle', 'mysql', 'sqlparse', 'tblib', 'numpy',
|
||||||
'bcrypt', 'argon2', 'xml.dom']
|
'bcrypt', 'argon2', 'xml.dom']
|
||||||
@@ -67,6 +67,9 @@ IGNORED_ERRORS = {
|
|||||||
'has no attribute "assert',
|
'has no attribute "assert',
|
||||||
'Unsupported dynamic base class'
|
'Unsupported dynamic base class'
|
||||||
],
|
],
|
||||||
|
'admin_utils': [
|
||||||
|
'"Article" has no attribute "non_field"',
|
||||||
|
],
|
||||||
'aggregation': [
|
'aggregation': [
|
||||||
re.compile(r'got "Optional\[(Author|Publisher)\]", expected "Union\[(Author|Publisher), Combinable\]"'),
|
re.compile(r'got "Optional\[(Author|Publisher)\]", expected "Union\[(Author|Publisher), Combinable\]"'),
|
||||||
'Argument 2 for "super" not an instance of argument 1',
|
'Argument 2 for "super" not an instance of argument 1',
|
||||||
@@ -382,6 +385,9 @@ IGNORED_ERRORS = {
|
|||||||
'expression has type "CurrentSiteManager[CustomArticle]", base class "AbstractArticle"',
|
'expression has type "CurrentSiteManager[CustomArticle]", base class "AbstractArticle"',
|
||||||
"Name 'Optional' is not defined",
|
"Name 'Optional' is not defined",
|
||||||
],
|
],
|
||||||
|
'sites_tests': [
|
||||||
|
'"RequestSite" of "Union[Site, RequestSite]" has no attribute "id"',
|
||||||
|
],
|
||||||
'syndication_tests': [
|
'syndication_tests': [
|
||||||
'List or tuple expected as variable arguments'
|
'List or tuple expected as variable arguments'
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user