reformat with black

This commit is contained in:
Maxim Kurnikov
2018-07-29 23:34:58 +03:00
parent 4866354600
commit cf85607969
343 changed files with 6054 additions and 2158 deletions

3
.gitignore vendored
View File

@@ -1 +1,4 @@
*.egg-info *.egg-info
__pycache__/
out/
/test_sqlite.py

View File

@@ -6,6 +6,7 @@ from typing import Any
from django.db.models.base import Model from django.db.models.base import Model
from typing import Any, Iterator, Type from typing import Any, Iterator, Type
MODELS_MODULE_NAME: str MODELS_MODULE_NAME: str
class AppConfig: class AppConfig:
@@ -23,6 +24,8 @@ class AppConfig:
@classmethod @classmethod
def create(cls, entry: str) -> AppConfig: ... def create(cls, entry: str) -> AppConfig: ...
def get_model(self, model_name: str, require_ready: bool = ...) -> Type[Model]: ... def get_model(self, model_name: str, require_ready: bool = ...) -> Type[Model]: ...
def get_models(self, include_auto_created: bool = ..., include_swapped: bool = ...) -> Iterator[Type[Model]]: ... def get_models(
self, include_auto_created: bool = ..., include_swapped: bool = ...
) -> Iterator[Type[Model]]: ...
def import_models(self) -> None: ... def import_models(self) -> None: ...
def ready(self) -> None: ... def ready(self) -> None: ...

View File

@@ -9,6 +9,7 @@ from django.apps.config import AppConfig
from django.db.migrations.state import AppConfigStub from django.db.migrations.state import AppConfigStub
from django.db.models.base import Model from django.db.models.base import Model
from typing import List, Optional, Tuple, Type, Union from typing import List, Optional, Tuple, Type, Union
class Apps: class Apps:
all_models: Any = ... all_models: Any = ...
app_configs: Any = ... app_configs: Any = ...
@@ -17,7 +18,9 @@ class Apps:
_lock: Any = ... _lock: Any = ...
loading: bool = ... loading: bool = ...
_pending_operations: Any = ... _pending_operations: Any = ...
def __init__(self, installed_apps: Union[Tuple, List[str], List[AppConfigStub]] = ...) -> None: ... def __init__(
self, installed_apps: Union[Tuple, List[str], List[AppConfigStub]] = ...
) -> None: ...
models_ready: bool = ... models_ready: bool = ...
ready: bool = ... ready: bool = ...
def populate(self, installed_apps: Optional[Any] = ...): ... def populate(self, installed_apps: Optional[Any] = ...): ...
@@ -26,7 +29,9 @@ class Apps:
def get_app_configs(self): ... def get_app_configs(self): ...
def get_app_config(self, app_label: str) -> AppConfig: ... def get_app_config(self, app_label: str) -> AppConfig: ...
def get_models(self, include_auto_created: bool = ..., include_swapped: bool = ...): ... def get_models(self, include_auto_created: bool = ..., include_swapped: bool = ...): ...
def get_model(self, app_label: str, model_name: None = ..., require_ready: bool = ...) -> Type[Model]: ... def get_model(
self, app_label: str, model_name: None = ..., require_ready: bool = ...
) -> Type[Model]: ...
def register_model(self, app_label: Any, model: Any) -> None: ... def register_model(self, app_label: Any, model: Any) -> None: ...
def is_installed(self, app_name: Any): ... def is_installed(self, app_name: Any): ...
def get_containing_app_config(self, object_name: str) -> Optional[AppConfig]: ... def get_containing_app_config(self, object_name: str) -> Optional[AppConfig]: ...

View File

@@ -6,7 +6,9 @@ from django.utils.functional import LazyObject
from typing import Any, Optional from typing import Any, Optional
from typing import Any, List from typing import Any, List
ENVIRONMENT_VARIABLE: str ENVIRONMENT_VARIABLE: str
class LazySettings(LazyObject): class LazySettings(LazyObject):
_wrapped: Any = ... _wrapped: Any = ...
def _setup(self, name: None = ...) -> None: ... def _setup(self, name: None = ...) -> None: ...

View File

@@ -7,9 +7,12 @@ from typing import Any, Optional
from django.urls.resolvers import URLPattern, URLResolver from django.urls.resolvers import URLPattern, URLResolver
from typing import Any, Optional, Union from typing import Any, Optional, Union
handler400: Any handler400: Any
handler403: Any handler403: Any
handler404: Any handler404: Any
handler500: Any handler500: Any
def url(regex: str, view: Any, kwargs: Any = ..., name: Optional[str] = ...) -> Union[URLPattern, URLResolver]: ... def url(
regex: str, view: Any, kwargs: Any = ..., name: Optional[str] = ...
) -> Union[URLPattern, URLResolver]: ...

View File

@@ -6,7 +6,10 @@ from typing import Any
from django.urls.resolvers import URLResolver from django.urls.resolvers import URLResolver
from typing import Any, List, Tuple, Union from typing import Any, List, Tuple, Union
def i18n_patterns(*urls: Any, prefix_default_language: bool = ...) -> Union[List[URLResolver], List[List[Any]]]: ...
def i18n_patterns(
*urls: Any, prefix_default_language: bool = ...
) -> Union[List[URLResolver], List[List[Any]]]: ...
def is_language_prefix_patterns_used(urlconf: str) -> Tuple[bool, bool]: ... def is_language_prefix_patterns_used(urlconf: str) -> Tuple[bool, bool]: ...
urlpatterns: Any urlpatterns: Any

View File

@@ -6,4 +6,5 @@ from typing import Any
from django.urls.resolvers import URLPattern from django.urls.resolvers import URLPattern
from typing import Callable, List from typing import Callable, List
def static(prefix: str, view: Callable = ..., **kwargs: Any) -> List[URLPattern]: ... def static(prefix: str, view: Callable = ..., **kwargs: Any) -> List[URLPattern]: ...

View File

@@ -3,9 +3,25 @@
# NOTE: This dynamically typed stub was automatically generated by stubgen. # NOTE: This dynamically typed stub was automatically generated by stubgen.
from django.contrib.admin.decorators import register as register from django.contrib.admin.decorators import register as register
from django.contrib.admin.filters import AllValuesFieldListFilter as AllValuesFieldListFilter, BooleanFieldListFilter as BooleanFieldListFilter, ChoicesFieldListFilter as ChoicesFieldListFilter, DateFieldListFilter as DateFieldListFilter, FieldListFilter as FieldListFilter, ListFilter as ListFilter, RelatedFieldListFilter as RelatedFieldListFilter, RelatedOnlyFieldListFilter as RelatedOnlyFieldListFilter, SimpleListFilter as SimpleListFilter from django.contrib.admin.filters import (
AllValuesFieldListFilter as AllValuesFieldListFilter,
BooleanFieldListFilter as BooleanFieldListFilter,
ChoicesFieldListFilter as ChoicesFieldListFilter,
DateFieldListFilter as DateFieldListFilter,
FieldListFilter as FieldListFilter,
ListFilter as ListFilter,
RelatedFieldListFilter as RelatedFieldListFilter,
RelatedOnlyFieldListFilter as RelatedOnlyFieldListFilter,
SimpleListFilter as SimpleListFilter,
)
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME as ACTION_CHECKBOX_NAME from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME as ACTION_CHECKBOX_NAME
from django.contrib.admin.options import HORIZONTAL as HORIZONTAL, ModelAdmin as ModelAdmin, StackedInline as StackedInline, TabularInline as TabularInline, VERTICAL as VERTICAL from django.contrib.admin.options import (
HORIZONTAL as HORIZONTAL,
ModelAdmin as ModelAdmin,
StackedInline as StackedInline,
TabularInline as TabularInline,
VERTICAL as VERTICAL,
)
from django.contrib.admin.sites import AdminSite as AdminSite, site as site from django.contrib.admin.sites import AdminSite as AdminSite, site as site
def autodiscover() -> None: ... def autodiscover() -> None: ...

View File

@@ -8,4 +8,7 @@ from django.contrib.admin.options import ModelAdmin
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
from django.db.models.query import QuerySet from django.db.models.query import QuerySet
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
def delete_selected(modeladmin: ModelAdmin, request: WSGIRequest, queryset: QuerySet) -> TemplateResponse: ...
def delete_selected(
modeladmin: ModelAdmin, request: WSGIRequest, queryset: QuerySet
) -> TemplateResponse: ...

View File

@@ -9,37 +9,113 @@ from django.contrib.auth.models import Group, User
from django.core.checks.messages import Error from django.core.checks.messages import Error
from django.db.models.base import Model from django.db.models.base import Model
from typing import Any, List, Tuple, Type, Union from typing import Any, List, Tuple, Type, Union
def check_admin_app(app_configs: Any, **kwargs: Any): ... def check_admin_app(app_configs: Any, **kwargs: Any): ...
def check_dependencies(**kwargs: Any): ... def check_dependencies(**kwargs: Any): ...
class BaseModelAdminChecks: class BaseModelAdminChecks:
def check(self, admin_obj: Union[ModelAdmin, InlineModelAdmin], **kwargs: Any) -> List[Error]: ... def check(
def _check_autocomplete_fields(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... self, admin_obj: Union[ModelAdmin, InlineModelAdmin], **kwargs: Any
def _check_autocomplete_fields_item(self, obj: Union[ModelAdmin, InlineModelAdmin], model: Type[Model], field_name: str, label: str) -> List[Any]: ... ) -> List[Error]: ...
def _check_raw_id_fields(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... def _check_autocomplete_fields(
def _check_raw_id_fields_item(self, obj: ModelAdmin, model: Type[Model], field_name: str, label: str) -> List[Any]: ... self, obj: Union[ModelAdmin, InlineModelAdmin]
) -> List[Any]: ...
def _check_autocomplete_fields_item(
self,
obj: Union[ModelAdmin, InlineModelAdmin],
model: Type[Model],
field_name: str,
label: str,
) -> List[Any]: ...
def _check_raw_id_fields(
self, obj: Union[ModelAdmin, InlineModelAdmin]
) -> List[Any]: ...
def _check_raw_id_fields_item(
self, obj: ModelAdmin, model: Type[Model], field_name: str, label: str
) -> List[Any]: ...
def _check_fields(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... def _check_fields(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
def _check_fieldsets(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... def _check_fieldsets(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
def _check_fieldsets_item(self, obj: Union[ModelAdmin, InlineModelAdmin], model: Type[Model], fieldset: Any, label: str, seen_fields: List[str]) -> List[Any]: ... def _check_fieldsets_item(
def _check_field_spec(self, obj: Union[ModelAdmin, InlineModelAdmin], model: Type[Model], fields: Union[str, Tuple[str, str, str, str], Tuple[str, str]], label: str) -> List[Any]: ... self,
def _check_field_spec_item(self, obj: Union[ModelAdmin, TabularInline], model: Type[Model], field_name: str, label: str) -> List[Any]: ... obj: Union[ModelAdmin, InlineModelAdmin],
model: Type[Model],
fieldset: Any,
label: str,
seen_fields: List[str],
) -> List[Any]: ...
def _check_field_spec(
self,
obj: Union[ModelAdmin, InlineModelAdmin],
model: Type[Model],
fields: Union[str, Tuple[str, str, str, str], Tuple[str, str]],
label: str,
) -> List[Any]: ...
def _check_field_spec_item(
self,
obj: Union[ModelAdmin, TabularInline],
model: Type[Model],
field_name: str,
label: str,
) -> List[Any]: ...
def _check_exclude(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... def _check_exclude(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
def _check_form(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... def _check_form(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
def _check_filter_vertical(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... def _check_filter_vertical(
def _check_filter_horizontal(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... self, obj: Union[ModelAdmin, InlineModelAdmin]
def _check_filter_item(self, obj: ModelAdmin, model: Type[Union[Group, User]], field_name: str, label: str) -> List[Any]: ... ) -> List[Any]: ...
def _check_radio_fields(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... def _check_filter_horizontal(
def _check_radio_fields_key(self, obj: Any, model: Any, field_name: Any, label: Any): ... self, obj: Union[ModelAdmin, InlineModelAdmin]
) -> List[Any]: ...
def _check_filter_item(
self, obj: ModelAdmin, model: Type[Union[Group, User]], field_name: str, label: str
) -> List[Any]: ...
def _check_radio_fields(
self, obj: Union[ModelAdmin, InlineModelAdmin]
) -> List[Any]: ...
def _check_radio_fields_key(
self, obj: Any, model: Any, field_name: Any, label: Any
): ...
def _check_radio_fields_value(self, obj: Any, val: Any, label: Any): ... def _check_radio_fields_value(self, obj: Any, val: Any, label: Any): ...
def _check_view_on_site_url(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... def _check_view_on_site_url(
def _check_prepopulated_fields(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... self, obj: Union[ModelAdmin, InlineModelAdmin]
def _check_prepopulated_fields_key(self, obj: Union[ModelAdmin, InlineModelAdmin], model: Type[Model], field_name: str, label: str) -> List[Any]: ... ) -> List[Any]: ...
def _check_prepopulated_fields_value(self, obj: Union[ModelAdmin, InlineModelAdmin], model: Type[Model], val: Union[List[str], Tuple[str]], label: str) -> List[Any]: ... def _check_prepopulated_fields(
def _check_prepopulated_fields_value_item(self, obj: Union[ModelAdmin, TabularInline], model: Type[Model], field_name: str, label: str) -> List[Any]: ... self, obj: Union[ModelAdmin, InlineModelAdmin]
) -> List[Any]: ...
def _check_prepopulated_fields_key(
self,
obj: Union[ModelAdmin, InlineModelAdmin],
model: Type[Model],
field_name: str,
label: str,
) -> List[Any]: ...
def _check_prepopulated_fields_value(
self,
obj: Union[ModelAdmin, InlineModelAdmin],
model: Type[Model],
val: Union[List[str], Tuple[str]],
label: str,
) -> List[Any]: ...
def _check_prepopulated_fields_value_item(
self,
obj: Union[ModelAdmin, TabularInline],
model: Type[Model],
field_name: str,
label: str,
) -> List[Any]: ...
def _check_ordering(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... def _check_ordering(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
def _check_ordering_item(self, obj: ModelAdmin, model: Type[Model], field_name: str, label: str) -> List[Any]: ... def _check_ordering_item(
def _check_readonly_fields(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ... self, obj: ModelAdmin, model: Type[Model], field_name: str, label: str
def _check_readonly_fields_item(self, obj: Union[ModelAdmin, TabularInline], model: Type[Model], field_name: str, label: str) -> List[Any]: ... ) -> List[Any]: ...
def _check_readonly_fields(
self, obj: Union[ModelAdmin, InlineModelAdmin]
) -> List[Any]: ...
def _check_readonly_fields_item(
self,
obj: Union[ModelAdmin, TabularInline],
model: Type[Model],
field_name: str,
label: str,
) -> List[Any]: ...
class ModelAdminChecks(BaseModelAdminChecks): class ModelAdminChecks(BaseModelAdminChecks):
def check(self, admin_obj: Any, **kwargs: Any): ... def check(self, admin_obj: Any, **kwargs: Any): ...
@@ -57,15 +133,21 @@ class ModelAdminChecks(BaseModelAdminChecks):
def _check_list_per_page(self, obj: Any): ... def _check_list_per_page(self, obj: Any): ...
def _check_list_max_show_all(self, obj: Any): ... def _check_list_max_show_all(self, obj: Any): ...
def _check_list_editable(self, obj: Any): ... def _check_list_editable(self, obj: Any): ...
def _check_list_editable_item(self, obj: Any, model: Any, field_name: Any, label: Any): ... def _check_list_editable_item(
self, obj: Any, model: Any, field_name: Any, label: Any
): ...
def _check_search_fields(self, obj: Any): ... def _check_search_fields(self, obj: Any): ...
def _check_date_hierarchy(self, obj: Any): ... def _check_date_hierarchy(self, obj: Any): ...
def _check_action_permission_methods(self, obj: Any): ... def _check_action_permission_methods(self, obj: Any): ...
class InlineModelAdminChecks(BaseModelAdminChecks): class InlineModelAdminChecks(BaseModelAdminChecks):
def check(self, inline_obj: Any, **kwargs: Any): ... def check(self, inline_obj: Any, **kwargs: Any): ...
def _check_exclude_of_parent_model(self, obj: InlineModelAdmin, parent_model: Type[Model]) -> List[Any]: ... def _check_exclude_of_parent_model(
def _check_relation(self, obj: InlineModelAdmin, parent_model: Type[Model]) -> List[Any]: ... self, obj: InlineModelAdmin, parent_model: Type[Model]
) -> List[Any]: ...
def _check_relation(
self, obj: InlineModelAdmin, parent_model: Type[Model]
) -> List[Any]: ...
def _check_extra(self, obj: InlineModelAdmin) -> List[Any]: ... def _check_extra(self, obj: InlineModelAdmin) -> List[Any]: ...
def _check_max_num(self, obj: InlineModelAdmin) -> List[Any]: ... def _check_max_num(self, obj: InlineModelAdmin) -> List[Any]: ...
def _check_min_num(self, obj: InlineModelAdmin) -> List[Any]: ... def _check_min_num(self, obj: InlineModelAdmin) -> List[Any]: ...

View File

@@ -5,4 +5,5 @@
from typing import Any, Optional from typing import Any, Optional
from typing import Callable from typing import Callable
def register(*models: Any, site: Optional[Any] = ...) -> Callable: ... def register(*models: Any, site: Optional[Any] = ...) -> Callable: ...

View File

@@ -12,11 +12,18 @@ from django.db.models.fields.related import ForeignKey, ManyToManyField
from django.db.models.fields.reverse_related import ForeignObjectRel from django.db.models.fields.reverse_related import ForeignObjectRel
from django.db.models.query import QuerySet from django.db.models.query import QuerySet
from typing import Callable, Dict, List, Optional, Tuple, Type, Union from typing import Callable, Dict, List, Optional, Tuple, Type, Union
class ListFilter: class ListFilter:
title: Any = ... title: Any = ...
template: str = ... template: str = ...
used_parameters: Any = ... used_parameters: Any = ...
def __init__(self, request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin) -> None: ... def __init__(
self,
request: WSGIRequest,
params: Dict[str, str],
model: Type[Model],
model_admin: ModelAdmin,
) -> None: ...
def has_output(self) -> None: ... def has_output(self) -> None: ...
def choices(self, changelist: Any) -> None: ... def choices(self, changelist: Any) -> None: ...
def queryset(self, request: Any, queryset: Any) -> None: ... def queryset(self, request: Any, queryset: Any) -> None: ...
@@ -25,7 +32,13 @@ class ListFilter:
class SimpleListFilter(ListFilter): class SimpleListFilter(ListFilter):
parameter_name: Any = ... parameter_name: Any = ...
lookup_choices: Any = ... lookup_choices: Any = ...
def __init__(self, request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin) -> None: ... def __init__(
self,
request: WSGIRequest,
params: Dict[str, str],
model: Type[Model],
model_admin: ModelAdmin,
) -> None: ...
def has_output(self) -> bool: ... def has_output(self) -> bool: ...
def value(self) -> Optional[str]: ... def value(self) -> Optional[str]: ...
def lookups(self, request: Any, model_admin: Any) -> None: ... def lookups(self, request: Any, model_admin: Any) -> None: ...
@@ -38,13 +51,34 @@ class FieldListFilter(ListFilter):
field: Any = ... field: Any = ...
field_path: Any = ... field_path: Any = ...
title: Any = ... title: Any = ...
def __init__(self, field: Union[ForeignObjectRel, Field], request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin, field_path: str) -> None: ... def __init__(
self,
field: Union[ForeignObjectRel, Field],
request: WSGIRequest,
params: Dict[str, str],
model: Type[Model],
model_admin: ModelAdmin,
field_path: str,
) -> None: ...
def has_output(self) -> bool: ... def has_output(self) -> bool: ...
def queryset(self, request: WSGIRequest, queryset: QuerySet) -> QuerySet: ... def queryset(self, request: WSGIRequest, queryset: QuerySet) -> QuerySet: ...
@classmethod @classmethod
def register(cls, test: Callable, list_filter_class: Type[FieldListFilter], take_priority: bool = ...) -> None: ... def register(
cls,
test: Callable,
list_filter_class: Type[FieldListFilter],
take_priority: bool = ...,
) -> None: ...
@classmethod @classmethod
def create(cls, field: Union[ForeignObjectRel, Field], request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin, field_path: str) -> FieldListFilter: ... def create(
cls,
field: Union[ForeignObjectRel, Field],
request: WSGIRequest,
params: Dict[str, str],
model: Type[Model],
model_admin: ModelAdmin,
field_path: str,
) -> FieldListFilter: ...
class RelatedFieldListFilter(FieldListFilter): class RelatedFieldListFilter(FieldListFilter):
lookup_kwarg: Any = ... lookup_kwarg: Any = ...
@@ -55,12 +89,25 @@ class RelatedFieldListFilter(FieldListFilter):
lookup_title: Any = ... lookup_title: Any = ...
title: Any = ... title: Any = ...
empty_value_display: Any = ... empty_value_display: Any = ...
def __init__(self, field: Union[ForeignObjectRel, ManyToManyField, ForeignKey], request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin, field_path: str) -> None: ... def __init__(
self,
field: Union[ForeignObjectRel, ManyToManyField, ForeignKey],
request: WSGIRequest,
params: Dict[str, str],
model: Type[Model],
model_admin: ModelAdmin,
field_path: str,
) -> None: ...
@property @property
def include_empty_choice(self) -> bool: ... def include_empty_choice(self) -> bool: ...
def has_output(self) -> bool: ... def has_output(self) -> bool: ...
def expected_parameters(self) -> List[str]: ... def expected_parameters(self) -> List[str]: ...
def field_choices(self, field: Union[ForeignObjectRel, ManyToManyField, ForeignKey], request: WSGIRequest, model_admin: ModelAdmin) -> Union[List[Tuple[str, str]], List[Tuple[int, str]]]: ... def field_choices(
self,
field: Union[ForeignObjectRel, ManyToManyField, ForeignKey],
request: WSGIRequest,
model_admin: ModelAdmin,
) -> Union[List[Tuple[str, str]], List[Tuple[int, str]]]: ...
def choices(self, changelist: Any) -> None: ... def choices(self, changelist: Any) -> None: ...
class BooleanFieldListFilter(FieldListFilter): class BooleanFieldListFilter(FieldListFilter):
@@ -68,7 +115,15 @@ class BooleanFieldListFilter(FieldListFilter):
lookup_kwarg2: Any = ... lookup_kwarg2: Any = ...
lookup_val: Any = ... lookup_val: Any = ...
lookup_val2: Any = ... lookup_val2: Any = ...
def __init__(self, field: BooleanField, request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin, field_path: str) -> None: ... def __init__(
self,
field: BooleanField,
request: WSGIRequest,
params: Dict[str, str],
model: Type[Model],
model_admin: ModelAdmin,
field_path: str,
) -> None: ...
def expected_parameters(self) -> List[str]: ... def expected_parameters(self) -> List[str]: ...
def choices(self, changelist: Any) -> None: ... def choices(self, changelist: Any) -> None: ...
@@ -77,7 +132,15 @@ class ChoicesFieldListFilter(FieldListFilter):
lookup_kwarg_isnull: Any = ... lookup_kwarg_isnull: Any = ...
lookup_val: Any = ... lookup_val: Any = ...
lookup_val_isnull: Any = ... lookup_val_isnull: Any = ...
def __init__(self, field: Field, request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin, field_path: str) -> None: ... def __init__(
self,
field: Field,
request: WSGIRequest,
params: Dict[str, str],
model: Type[Model],
model_admin: ModelAdmin,
field_path: str,
) -> None: ...
def expected_parameters(self) -> List[str]: ... def expected_parameters(self) -> List[str]: ...
def choices(self, changelist: Any) -> None: ... def choices(self, changelist: Any) -> None: ...
@@ -88,7 +151,15 @@ class DateFieldListFilter(FieldListFilter):
lookup_kwarg_until: Any = ... lookup_kwarg_until: Any = ...
links: Any = ... links: Any = ...
lookup_kwarg_isnull: Any = ... lookup_kwarg_isnull: Any = ...
def __init__(self, field: DateField, request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin, field_path: str) -> None: ... def __init__(
self,
field: DateField,
request: WSGIRequest,
params: Dict[str, str],
model: Type[Model],
model_admin: ModelAdmin,
field_path: str,
) -> None: ...
def expected_parameters(self) -> List[str]: ... def expected_parameters(self) -> List[str]: ...
def choices(self, changelist: Any) -> None: ... def choices(self, changelist: Any) -> None: ...
@@ -99,9 +170,22 @@ class AllValuesFieldListFilter(FieldListFilter):
lookup_val_isnull: Any = ... lookup_val_isnull: Any = ...
empty_value_display: Any = ... empty_value_display: Any = ...
lookup_choices: Any = ... lookup_choices: Any = ...
def __init__(self, field: Field, request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin, field_path: str) -> None: ... def __init__(
self,
field: Field,
request: WSGIRequest,
params: Dict[str, str],
model: Type[Model],
model_admin: ModelAdmin,
field_path: str,
) -> None: ...
def expected_parameters(self) -> List[str]: ... def expected_parameters(self) -> List[str]: ...
def choices(self, changelist: Any) -> None: ... def choices(self, changelist: Any) -> None: ...
class RelatedOnlyFieldListFilter(RelatedFieldListFilter): class RelatedOnlyFieldListFilter(RelatedFieldListFilter):
def field_choices(self, field: Union[ManyToManyField, ForeignKey], request: WSGIRequest, model_admin: ModelAdmin) -> Union[List[Tuple[str, str]], List[Tuple[int, str]]]: ... def field_choices(
self,
field: Union[ManyToManyField, ForeignKey],
request: WSGIRequest,
model_admin: ModelAdmin,
) -> Union[List[Tuple[str, str]], List[Tuple[int, str]]]: ...

View File

@@ -1,5 +1,4 @@
from django.contrib.auth.models import User from django.contrib.auth.models import User
class AdminAuthenticationForm: class AdminAuthenticationForm:
def confirm_login_allowed(self, user: User) -> None: ... def confirm_login_allowed(self, user: User) -> None: ...

View File

@@ -11,6 +11,7 @@ from django.forms.utils import ErrorDict
from django.forms.widgets import Media from django.forms.widgets import Media
from django.utils.safestring import SafeText from django.utils.safestring import SafeText
from typing import Any, Callable, Dict, Iterator, List, Tuple, Union from typing import Any, Callable, Dict, Iterator, List, Tuple, Union
ACTION_CHECKBOX_NAME: str ACTION_CHECKBOX_NAME: str
class ActionForm(forms.Form): class ActionForm(forms.Form):
@@ -23,7 +24,14 @@ class AdminForm:
prepopulated_fields: Any = ... prepopulated_fields: Any = ...
model_admin: Any = ... model_admin: Any = ...
readonly_fields: Any = ... readonly_fields: Any = ...
def __init__(self, form: AdminPasswordChangeForm, fieldsets: List[Tuple[None, Dict[str, List[str]]]], prepopulated_fields: Dict[Any, Any], readonly_fields: None = ..., model_admin: None = ...) -> None: ... def __init__(
self,
form: AdminPasswordChangeForm,
fieldsets: List[Tuple[None, Dict[str, List[str]]]],
prepopulated_fields: Dict[Any, Any],
readonly_fields: None = ...,
model_admin: None = ...,
) -> None: ...
def __iter__(self) -> Iterator[Fieldset]: ... def __iter__(self) -> Iterator[Fieldset]: ...
@property @property
def errors(self) -> ErrorDict: ... def errors(self) -> ErrorDict: ...
@@ -38,7 +46,16 @@ class Fieldset:
description: Any = ... description: Any = ...
model_admin: Any = ... model_admin: Any = ...
readonly_fields: Any = ... readonly_fields: Any = ...
def __init__(self, form: Any, name: Optional[Any] = ..., readonly_fields: Any = ..., fields: Any = ..., classes: Any = ..., description: Optional[Any] = ..., model_admin: Optional[Any] = ...) -> None: ... def __init__(
self,
form: Any,
name: Optional[Any] = ...,
readonly_fields: Any = ...,
fields: Any = ...,
classes: Any = ...,
description: Optional[Any] = ...,
model_admin: Optional[Any] = ...,
) -> None: ...
@property @property
def media(self) -> Media: ... def media(self) -> Media: ...
def __iter__(self) -> Iterator[Fieldline]: ... def __iter__(self) -> Iterator[Fieldline]: ...
@@ -49,7 +66,13 @@ class Fieldline:
has_visible_field: Any = ... has_visible_field: Any = ...
model_admin: Any = ... model_admin: Any = ...
readonly_fields: Any = ... readonly_fields: Any = ...
def __init__(self, form: Any, field: Any, readonly_fields: Optional[Any] = ..., model_admin: Optional[Any] = ...) -> None: ... def __init__(
self,
form: Any,
field: Any,
readonly_fields: Optional[Any] = ...,
model_admin: Optional[Any] = ...,
) -> None: ...
def __iter__(self) -> Iterator[Union[AdminField, AdminReadonlyField]]: ... def __iter__(self) -> Iterator[Union[AdminField, AdminReadonlyField]]: ...
def errors(self) -> SafeText: ... def errors(self) -> SafeText: ...
@@ -70,7 +93,9 @@ class AdminReadonlyField:
is_checkbox: bool = ... is_checkbox: bool = ...
is_readonly: bool = ... is_readonly: bool = ...
empty_value_display: Any = ... empty_value_display: Any = ...
def __init__(self, form: Any, field: Any, is_first: Any, model_admin: Optional[Any] = ...) -> None: ... def __init__(
self, form: Any, field: Any, is_first: Any, model_admin: Optional[Any] = ...
) -> None: ...
def label_tag(self) -> SafeText: ... def label_tag(self) -> SafeText: ...
def contents(self) -> SafeText: ... def contents(self) -> SafeText: ...
@@ -86,7 +111,19 @@ class InlineAdminFormSet:
has_change_permission: Any = ... has_change_permission: Any = ...
has_delete_permission: Any = ... has_delete_permission: Any = ...
has_view_permission: Any = ... has_view_permission: Any = ...
def __init__(self, inline: Any, formset: Any, fieldsets: Any, prepopulated_fields: Optional[Any] = ..., readonly_fields: Optional[Any] = ..., model_admin: Optional[Any] = ..., has_add_permission: bool = ..., has_change_permission: bool = ..., has_delete_permission: bool = ..., has_view_permission: bool = ...) -> None: ... def __init__(
self,
inline: Any,
formset: Any,
fieldsets: Any,
prepopulated_fields: Optional[Any] = ...,
readonly_fields: Optional[Any] = ...,
model_admin: Optional[Any] = ...,
has_add_permission: bool = ...,
has_change_permission: bool = ...,
has_delete_permission: bool = ...,
has_view_permission: bool = ...,
) -> None: ...
def __iter__(self) -> Iterator[InlineAdminForm]: ... def __iter__(self) -> Iterator[InlineAdminForm]: ...
def fields(self) -> Iterator[Dict[str, Any]]: ... def fields(self) -> Iterator[Dict[str, Any]]: ...
def inline_formset_data(self) -> str: ... def inline_formset_data(self) -> str: ...
@@ -103,7 +140,17 @@ class InlineAdminForm(AdminForm):
original: Any = ... original: Any = ...
show_url: Any = ... show_url: Any = ...
absolute_url: Any = ... absolute_url: Any = ...
def __init__(self, formset: Any, form: Any, fieldsets: Any, prepopulated_fields: Any, original: Any, readonly_fields: Optional[Any] = ..., model_admin: Optional[Any] = ..., view_on_site_url: Optional[Any] = ...) -> None: ... def __init__(
self,
formset: Any,
form: Any,
fieldsets: Any,
prepopulated_fields: Any,
original: Any,
readonly_fields: Optional[Any] = ...,
model_admin: Optional[Any] = ...,
view_on_site_url: Optional[Any] = ...,
) -> None: ...
def __iter__(self) -> Iterator[InlineFieldset]: ... def __iter__(self) -> Iterator[InlineFieldset]: ...
def needs_explicit_pk_field(self) -> Union[bool, AutoField]: ... def needs_explicit_pk_field(self) -> Union[bool, AutoField]: ...
def pk_field(self) -> AdminField: ... def pk_field(self) -> AdminField: ...

View File

@@ -1,6 +1,5 @@
from typing import Any from typing import Any
class LogEntry: class LogEntry:
def __str__(self) -> str: ... def __str__(self) -> str: ...
def get_admin_url(self) -> str: ... def get_admin_url(self) -> str: ...
@@ -9,7 +8,6 @@ class LogEntry:
def is_change(self) -> bool: ... def is_change(self) -> bool: ...
def is_deletion(self) -> bool: ... def is_deletion(self) -> bool: ...
class LogEntryManager: class LogEntryManager:
def log_action( def log_action(
self, self,
@@ -18,5 +16,5 @@ class LogEntryManager:
object_id: int, object_id: int,
object_repr: str, object_repr: str,
action_flag: int, action_flag: int,
change_message: Any = ... change_message: Any = ...,
) -> LogEntry: ... ) -> LogEntry: ...

View File

@@ -14,6 +14,7 @@ from django.forms.fields import Field, TypedChoiceField
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
from django.utils.safestring import SafeText from django.utils.safestring import SafeText
from typing import Any, Callable, Dict, List, Optional, Tuple, Union from typing import Any, Callable, Dict, List, Optional, Tuple, Union
IS_POPUP_VAR: str IS_POPUP_VAR: str
TO_FIELD_VAR: str TO_FIELD_VAR: str
HORIZONTAL: Any HORIZONTAL: Any
@@ -47,28 +48,50 @@ class BaseModelAdmin:
checks_class: Any = ... checks_class: Any = ...
def check(self, **kwargs: Any) -> List[Error]: ... def check(self, **kwargs: Any) -> List[Error]: ...
def __init__(self) -> None: ... def __init__(self) -> None: ...
def formfield_for_dbfield(self, db_field: Field, request: object, **kwargs: Any) -> Optional[Field]: ... def formfield_for_dbfield(
def formfield_for_choice_field(self, db_field: Field, request: object, **kwargs: Any) -> TypedChoiceField: ... self, db_field: Field, request: object, **kwargs: Any
def get_field_queryset(self, db: None, db_field: Union[ManyToManyField, ForeignKey], request: object) -> Optional[QuerySet]: ... ) -> Optional[Field]: ...
def formfield_for_foreignkey(self, db_field: ForeignKey, request: object, **kwargs: Any) -> Optional[ModelChoiceField]: ... def formfield_for_choice_field(
def formfield_for_manytomany(self, db_field: ManyToManyField, request: WSGIRequest, **kwargs: Any) -> ModelMultipleChoiceField: ... self, db_field: Field, request: object, **kwargs: Any
) -> TypedChoiceField: ...
def get_field_queryset(
self, db: None, db_field: Union[ManyToManyField, ForeignKey], request: object
) -> Optional[QuerySet]: ...
def formfield_for_foreignkey(
self, db_field: ForeignKey, request: object, **kwargs: Any
) -> Optional[ModelChoiceField]: ...
def formfield_for_manytomany(
self, db_field: ManyToManyField, request: WSGIRequest, **kwargs: Any
) -> ModelMultipleChoiceField: ...
def get_autocomplete_fields(self, request: object) -> Tuple: ... def get_autocomplete_fields(self, request: object) -> Tuple: ...
def get_view_on_site_url(self, obj: Optional[Model] = ...) -> Optional[str]: ... def get_view_on_site_url(self, obj: Optional[Model] = ...) -> Optional[str]: ...
def get_empty_value_display(self) -> SafeText: ... def get_empty_value_display(self) -> SafeText: ...
def get_exclude(self, request: object, obj: Optional[Model] = ...) -> None: ... def get_exclude(self, request: object, obj: Optional[Model] = ...) -> None: ...
def get_fields(self, request: object, obj: Optional[Model] = ...) -> Union[List[str], List[Union[str, Callable]]]: ... def get_fields(
self, request: object, obj: Optional[Model] = ...
) -> Union[List[str], List[Union[str, Callable]]]: ...
def get_fieldsets(self, request: WSGIRequest, obj: Optional[Model] = ...) -> Any: ... def get_fieldsets(self, request: WSGIRequest, obj: Optional[Model] = ...) -> Any: ...
def get_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ... def get_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
def get_readonly_fields(self, request: object, obj: Optional[Model] = ...) -> Union[List[str], Tuple]: ... def get_readonly_fields(
def get_prepopulated_fields(self, request: WSGIRequest, obj: Optional[Model] = ...) -> Dict[str, Tuple[str]]: ... self, request: object, obj: Optional[Model] = ...
) -> Union[List[str], Tuple]: ...
def get_prepopulated_fields(
self, request: WSGIRequest, obj: Optional[Model] = ...
) -> Dict[str, Tuple[str]]: ...
def get_queryset(self, request: object) -> QuerySet: ... def get_queryset(self, request: object) -> QuerySet: ...
def get_sortable_by(self, request: WSGIRequest) -> Union[List[str], Tuple]: ... def get_sortable_by(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
def lookup_allowed(self, lookup: Any, value: Any): ... def lookup_allowed(self, lookup: Any, value: Any): ...
def to_field_allowed(self, request: Any, to_field: Any): ... def to_field_allowed(self, request: Any, to_field: Any): ...
def has_add_permission(self, request: WSGIRequest) -> bool: ... def has_add_permission(self, request: WSGIRequest) -> bool: ...
def has_change_permission(self, request: object, obj: Optional[Model] = ...) -> bool: ... def has_change_permission(
def has_delete_permission(self, request: object, obj: Optional[Model] = ...) -> bool: ... self, request: object, obj: Optional[Model] = ...
def has_view_permission(self, request: WSGIRequest, obj: Optional[Model] = ...) -> bool: ... ) -> bool: ...
def has_delete_permission(
self, request: object, obj: Optional[Model] = ...
) -> bool: ...
def has_view_permission(
self, request: WSGIRequest, obj: Optional[Model] = ...
) -> bool: ...
def has_module_permission(self, request: object) -> bool: ... def has_module_permission(self, request: object) -> bool: ...
class ModelAdmin(BaseModelAdmin): class ModelAdmin(BaseModelAdmin):
@@ -113,14 +136,23 @@ class ModelAdmin(BaseModelAdmin):
def media(self): ... def media(self): ...
def get_model_perms(self, request: Any): ... def get_model_perms(self, request: Any): ...
def _get_form_for_get_fields(self, request: Any, obj: Any): ... def _get_form_for_get_fields(self, request: Any, obj: Any): ...
def get_form(self, request: Any, obj: Optional[Any] = ..., change: bool = ..., **kwargs: Any): ... def get_form(
self, request: Any, obj: Optional[Any] = ..., change: bool = ..., **kwargs: Any
): ...
def get_changelist(self, request: Any, **kwargs: Any): ... def get_changelist(self, request: Any, **kwargs: Any): ...
def get_changelist_instance(self, request: Any): ... def get_changelist_instance(self, request: Any): ...
def get_object(self, request: Any, object_id: Any, from_field: Optional[Any] = ...): ... def get_object(self, request: Any, object_id: Any, from_field: Optional[Any] = ...): ...
def get_changelist_form(self, request: Any, **kwargs: Any): ... def get_changelist_form(self, request: Any, **kwargs: Any): ...
def get_changelist_formset(self, request: Any, **kwargs: Any): ... def get_changelist_formset(self, request: Any, **kwargs: Any): ...
def get_formsets_with_inlines(self, request: Any, obj: Optional[Any] = ...) -> None: ... def get_formsets_with_inlines(self, request: Any, obj: Optional[Any] = ...) -> None: ...
def get_paginator(self, request: Any, queryset: Any, per_page: Any, orphans: int = ..., allow_empty_first_page: bool = ...): ... def get_paginator(
self,
request: Any,
queryset: Any,
per_page: Any,
orphans: int = ...,
allow_empty_first_page: bool = ...,
): ...
def log_addition(self, request: Any, object: Any, message: Any): ... def log_addition(self, request: Any, object: Any, message: Any): ...
def log_change(self, request: Any, object: Any, message: Any): ... def log_change(self, request: Any, object: Any, message: Any): ...
def log_deletion(self, request: Any, object: Any, object_repr: Any): ... def log_deletion(self, request: Any, object: Any, object_repr: Any): ...
@@ -137,37 +169,78 @@ class ModelAdmin(BaseModelAdmin):
def get_search_fields(self, request: Any): ... def get_search_fields(self, request: Any): ...
def get_search_results(self, request: Any, queryset: Any, search_term: Any): ... def get_search_results(self, request: Any, queryset: Any, search_term: Any): ...
def get_preserved_filters(self, request: Any): ... def get_preserved_filters(self, request: Any): ...
def construct_change_message(self, request: Any, form: Any, formsets: Any, add: bool = ...): ... def construct_change_message(
def message_user(self, request: Any, message: Any, level: Any = ..., extra_tags: str = ..., fail_silently: bool = ...) -> None: ... self, request: Any, form: Any, formsets: Any, add: bool = ...
): ...
def message_user(
self,
request: Any,
message: Any,
level: Any = ...,
extra_tags: str = ...,
fail_silently: bool = ...,
) -> None: ...
def save_form(self, request: Any, form: Any, change: Any): ... def save_form(self, request: Any, form: Any, change: Any): ...
def save_model(self, request: Any, obj: Any, form: Any, change: Any) -> None: ... def save_model(self, request: Any, obj: Any, form: Any, change: Any) -> None: ...
def delete_model(self, request: Any, obj: Any) -> None: ... def delete_model(self, request: Any, obj: Any) -> None: ...
def delete_queryset(self, request: Any, queryset: Any) -> None: ... def delete_queryset(self, request: Any, queryset: Any) -> None: ...
def save_formset(self, request: Any, form: Any, formset: Any, change: Any) -> None: ... def save_formset(self, request: Any, form: Any, formset: Any, change: Any) -> None: ...
def save_related(self, request: Any, form: Any, formsets: Any, change: Any) -> None: ... def save_related(self, request: Any, form: Any, formsets: Any, change: Any) -> None: ...
def render_change_form(self, request: Any, context: Any, add: bool = ..., change: bool = ..., form_url: str = ..., obj: Optional[Any] = ...): ... def render_change_form(
def response_add(self, request: Any, obj: Any, post_url_continue: Optional[Any] = ...): ... self,
request: Any,
context: Any,
add: bool = ...,
change: bool = ...,
form_url: str = ...,
obj: Optional[Any] = ...,
): ...
def response_add(
self, request: Any, obj: Any, post_url_continue: Optional[Any] = ...
): ...
def response_change(self, request: Any, obj: Any): ... def response_change(self, request: Any, obj: Any): ...
def response_post_save_add(self, request: Any, obj: Any): ... def response_post_save_add(self, request: Any, obj: Any): ...
def response_post_save_change(self, request: Any, obj: Any): ... def response_post_save_change(self, request: Any, obj: Any): ...
def response_action(self, request: Any, queryset: Any): ... def response_action(self, request: Any, queryset: Any): ...
def response_delete(self, request: Any, obj_display: Any, obj_id: Any): ... def response_delete(self, request: Any, obj_display: Any, obj_id: Any): ...
def render_delete_form(self, request: Any, context: Any): ... def render_delete_form(self, request: Any, context: Any): ...
def get_inline_formsets(self, request: Any, formsets: Any, inline_instances: Any, obj: Optional[Any] = ...): ... def get_inline_formsets(
self, request: Any, formsets: Any, inline_instances: Any, obj: Optional[Any] = ...
): ...
def get_changeform_initial_data(self, request: Any): ... def get_changeform_initial_data(self, request: Any): ...
def _get_obj_does_not_exist_redirect(self, request: Any, opts: Any, object_id: Any): ... def _get_obj_does_not_exist_redirect(self, request: Any, opts: Any, object_id: Any): ...
def changeform_view(self, request: Any, object_id: Optional[Any] = ..., form_url: str = ..., extra_context: Optional[Any] = ...): ... def changeform_view(
def _changeform_view(self, request: Any, object_id: Any, form_url: Any, extra_context: Any): ... self,
request: Any,
object_id: Optional[Any] = ...,
form_url: str = ...,
extra_context: Optional[Any] = ...,
): ...
def _changeform_view(
self, request: Any, object_id: Any, form_url: Any, extra_context: Any
): ...
def autocomplete_view(self, request: Any): ... def autocomplete_view(self, request: Any): ...
def add_view(self, request: Any, form_url: str = ..., extra_context: Optional[Any] = ...): ... def add_view(
def change_view(self, request: Any, object_id: Any, form_url: str = ..., extra_context: Optional[Any] = ...): ... self, request: Any, form_url: str = ..., extra_context: Optional[Any] = ...
): ...
def change_view(
self,
request: Any,
object_id: Any,
form_url: str = ...,
extra_context: Optional[Any] = ...,
): ...
def _get_edited_object_pks(self, request: Any, prefix: Any): ... def _get_edited_object_pks(self, request: Any, prefix: Any): ...
def _get_list_editable_queryset(self, request: Any, prefix: Any): ... def _get_list_editable_queryset(self, request: Any, prefix: Any): ...
def changelist_view(self, request: Any, extra_context: Optional[Any] = ...): ... def changelist_view(self, request: Any, extra_context: Optional[Any] = ...): ...
def get_deleted_objects(self, objs: Any, request: Any): ... def get_deleted_objects(self, objs: Any, request: Any): ...
def delete_view(self, request: Any, object_id: Any, extra_context: Optional[Any] = ...): ... def delete_view(
self, request: Any, object_id: Any, extra_context: Optional[Any] = ...
): ...
def _delete_view(self, request: Any, object_id: Any, extra_context: Any): ... def _delete_view(self, request: Any, object_id: Any, extra_context: Any): ...
def history_view(self, request: Any, object_id: Any, extra_context: Optional[Any] = ...): ... def history_view(
self, request: Any, object_id: Any, extra_context: Optional[Any] = ...
): ...
def _create_formsets(self, request: Any, obj: Any, change: Any): ... def _create_formsets(self, request: Any, obj: Any, change: Any): ...
class InlineModelAdmin(BaseModelAdmin): class InlineModelAdmin(BaseModelAdmin):

View File

@@ -11,6 +11,7 @@ from django.http.response import HttpResponse, HttpResponseRedirect
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.urls.resolvers import URLPattern, URLResolver from django.urls.resolvers import URLPattern, URLResolver
from typing import Any, Callable, Dict, List, Tuple, Type, Union from typing import Any, Callable, Dict, List, Tuple, Type, Union
all_sites: Any all_sites: Any
class AlreadyRegistered(Exception): ... class AlreadyRegistered(Exception): ...
@@ -35,7 +36,9 @@ class AdminSite:
_global_actions: Any = ... _global_actions: Any = ...
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: None) -> List[Any]: ...
def register(self, model_or_iterable: Any, admin_class: Any = ..., **options: Any) -> None: ... def register(
self, model_or_iterable: Any, admin_class: Any = ..., **options: Any
) -> None: ...
def unregister(self, model_or_iterable: Type[Model]) -> None: ... def unregister(self, model_or_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: None = ...) -> None: ...
@@ -51,17 +54,38 @@ class AdminSite:
def admin_view(self, view: Callable, cacheable: bool = ...) -> Callable: ... def admin_view(self, view: Callable, cacheable: bool = ...) -> Callable: ...
def get_urls(self) -> List[Union[URLPattern, URLResolver]]: ... def get_urls(self) -> List[Union[URLPattern, URLResolver]]: ...
@property @property
def urls(self) -> Union[Tuple[List[URLPattern], str, str], Tuple[List[Union[URLPattern, URLResolver]], str, str]]: ... def urls(
self
) -> Union[
Tuple[List[URLPattern], str, str],
Tuple[List[Union[URLPattern, 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: Dict[str, str] = ...
def i18n_javascript(self, request: WSGIRequest, extra_context: None = ...) -> HttpResponse: ... ) -> TemplateResponse: ...
def logout(self, request: WSGIRequest, extra_context: None = ...) -> TemplateResponse: ... def password_change_done(
def login(self, request: WSGIRequest, extra_context: None = ...) -> Union[TemplateResponse, HttpResponseRedirect]: ... self, request: WSGIRequest, extra_context: None = ...
def _build_app_dict(self, request: WSGIRequest, label: None = ...) -> Dict[Any, Any]: ... ) -> TemplateResponse: ...
def i18n_javascript(
self, request: WSGIRequest, extra_context: None = ...
) -> HttpResponse: ...
def logout(
self, request: WSGIRequest, extra_context: None = ...
) -> TemplateResponse: ...
def login(
self, request: WSGIRequest, extra_context: None = ...
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
def _build_app_dict(
self, request: WSGIRequest, label: None = ...
) -> Dict[Any, Any]: ...
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: None = ...) -> TemplateResponse: ... def index(
def app_index(self, request: WSGIRequest, app_label: str, extra_context: None = ...) -> TemplateResponse: ... self, request: WSGIRequest, extra_context: None = ...
) -> TemplateResponse: ...
def app_index(
self, request: WSGIRequest, app_label: str, extra_context: None = ...
) -> TemplateResponse: ...
class DefaultAdminSite(LazyObject): class DefaultAdminSite(LazyObject):
_wrapped: Any = ... _wrapped: Any = ...

View File

@@ -14,6 +14,7 @@ from django.template.base import Parser, Token
from django.template.context import RequestContext from django.template.context import RequestContext
from django.utils.safestring import SafeText from django.utils.safestring import SafeText
from typing import Any, Callable, Dict, Iterator, Optional, Union from typing import Any, Callable, Dict, Iterator, Optional, Union
register: Any register: Any
DOT: str DOT: str

View File

@@ -9,6 +9,7 @@ from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.templatetags.base import InclusionAdminNode from django.contrib.admin.templatetags.base import InclusionAdminNode
from django.template.base import Parser, Token from django.template.base import Parser, Token
from django.template.context import Context, RequestContext from django.template.context import Context, RequestContext
register: Any register: Any
def prepopulated_fields_js(context: RequestContext) -> RequestContext: ... def prepopulated_fields_js(context: RequestContext) -> RequestContext: ...

View File

@@ -9,8 +9,14 @@ from django.template.context import RequestContext
from django.utils.safestring import SafeText from django.utils.safestring import SafeText
from typing import Dict, Optional, Union from typing import Dict, Optional, Union
from uuid import UUID from uuid import UUID
register: Any register: Any
def admin_urlname(value: Options, arg: SafeText) -> str: ... def admin_urlname(value: Options, arg: SafeText) -> str: ...
def admin_urlquote(value: Union[str, int, UUID]) -> Union[str, int, UUID]: ... def admin_urlquote(value: Union[str, int, UUID]) -> Union[str, int, UUID]: ...
def add_preserved_filters(context: Union[Dict[str, Union[str, Options]], RequestContext], url: str, popup: bool = ..., to_field: Optional[str] = ...) -> str: ... def add_preserved_filters(
context: Union[Dict[str, Union[str, Options]], RequestContext],
url: str,
popup: bool = ...,
to_field: Optional[str] = ...,
) -> str: ...

View File

@@ -9,7 +9,15 @@ from django.template.base import Parser, Token
from django.template.context import Context from django.template.context import Context
from django.utils.safestring import SafeText from django.utils.safestring import SafeText
from typing import Callable from typing import Callable
class InclusionAdminNode(InclusionNode): class InclusionAdminNode(InclusionNode):
template_name: Any = ... template_name: Any = ...
def __init__(self, parser: Parser, token: Token, func: Callable, template_name: str, takes_context: bool = ...) -> None: ... def __init__(
self,
parser: Parser,
token: Token,
func: Callable,
template_name: str,
takes_context: bool = ...,
) -> None: ...
def render(self, context: Context) -> SafeText: ... def render(self, context: Context) -> SafeText: ...

View File

@@ -1,15 +1,7 @@
from django.template.base import ( from django.template.base import Parser, Token
Parser,
Token,
)
from django.template.context import Context from django.template.context import Context
def get_admin_log(parser: Parser, token: Token) -> AdminLogNode: ...
def get_admin_log(
parser: Parser,
token: Token
) -> AdminLogNode: ...
class AdminLogNode: class AdminLogNode:
def __init__(self, limit: str, varname: str, user: str) -> None: ... def __init__(self, limit: str, varname: str, user: str) -> None: ...

View File

@@ -11,18 +11,28 @@ from django.contrib.auth.forms import AdminPasswordChangeForm
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.db.models.base import Model from django.db.models.base import Model
from django.db.models.fields import Field from django.db.models.fields import Field
from django.db.models.fields.reverse_related import ForeignObjectRel, ManyToManyRel, ManyToOneRel, OneToOneRel from django.db.models.fields.reverse_related import (
ForeignObjectRel,
ManyToManyRel,
ManyToOneRel,
OneToOneRel,
)
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 typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
from uuid import UUID from uuid import UUID
class FieldIsAForeignKeyColumnName(Exception): ... class FieldIsAForeignKeyColumnName(Exception): ...
def lookup_needs_distinct(opts: Options, lookup_path: str) -> bool: ... def lookup_needs_distinct(opts: Options, lookup_path: str) -> bool: ...
def prepare_lookup_value(key: str, value: Union[str, datetime]) -> Union[bool, datetime, str]: ... def prepare_lookup_value(
key: str, value: Union[str, datetime]
) -> Union[bool, datetime, str]: ...
def quote(s: Union[str, UUID, int]) -> Union[str, UUID, int]: ... def quote(s: Union[str, UUID, int]) -> Union[str, UUID, int]: ...
def unquote(s: str) -> str: ... def unquote(s: str) -> str: ...
def flatten(fields: Union[Tuple, List[Union[str, Callable]], List[str]]) -> Union[List[Union[str, Callable]], List[str]]: ... def flatten(
fields: Union[Tuple, List[Union[str, Callable]], List[str]]
) -> Union[List[Union[str, Callable]], List[str]]: ...
def flatten_fieldsets(fieldsets: Any) -> Union[List[str], List[Union[str, Callable]]]: ... def flatten_fieldsets(fieldsets: Any) -> Union[List[str], List[Union[str, Callable]]]: ...
def get_deleted_objects(objs: Any, request: Any, admin_site: Any): ... def get_deleted_objects(objs: Any, request: Any, admin_site: Any): ...
@@ -32,24 +42,49 @@ 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(self, objs: Union[List[Model], QuerySet], source: Optional[Type[Model]] = ..., source_attr: Optional[str] = ..., **kwargs: Any) -> None: ... def collect(
def related_objects(self, related: ManyToOneRel, objs: Union[List[User], List[Model]]) -> QuerySet: ... self,
objs: Union[List[Model], QuerySet],
source: Optional[Type[Model]] = ...,
source_attr: Optional[str] = ...,
**kwargs: Any,
) -> None: ...
def related_objects(
self, related: ManyToOneRel, objs: Union[List[User], List[Model]]
) -> QuerySet: ...
def _nested(self, obj: Model, seen: Set[Model], format_callback: Callable) -> Any: ... def _nested(self, obj: Model, seen: Set[Model], format_callback: Callable) -> Any: ...
def nested(self, format_callback: Callable = ...) -> Any: ... def nested(self, format_callback: Callable = ...) -> Any: ...
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ... 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: QuerySet, n: None = ...) -> str: ... def model_ngettext(obj: QuerySet, n: None = ...) -> str: ...
def lookup_field(name: Union[str, Callable], obj: Model, model_admin: Union[ModelAdmin, TabularInline] = ...) -> Any: ... def lookup_field(
def _get_non_gfk_field(opts: Options, name: Union[str, Callable]) -> Union[Field, reverse_related.ManyToManyRel, reverse_related.OneToOneRel]: ... name: Union[str, Callable],
def label_for_field(name: Union[str, Callable], model: Type[Model], model_admin: Optional[Union[ModelAdmin, TabularInline]] = ..., return_attr: bool = ...) -> Any: ... obj: Model,
model_admin: Union[ModelAdmin, TabularInline] = ...,
) -> Any: ...
def _get_non_gfk_field(
opts: Options, name: Union[str, Callable]
) -> Union[Field, reverse_related.ManyToManyRel, reverse_related.OneToOneRel]: ...
def label_for_field(
name: Union[str, Callable],
model: Type[Model],
model_admin: Optional[Union[ModelAdmin, TabularInline]] = ...,
return_attr: bool = ...,
) -> Any: ...
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(value: Any, field: Union[Field, reverse_related.OneToOneRel], empty_value_display: str) -> str: ... def display_for_field(
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[ForeignObjectRel, Field]) -> Type[Model]: ... def get_model_from_relation(field: Union[ForeignObjectRel, Field]) -> Type[Model]: ...
def reverse_field_path(model: Type[Model], path: str) -> Union[Tuple[Type[Model], str], Tuple[Type[User], str]]: ... def reverse_field_path(
model: Type[Model], path: str
) -> Union[Tuple[Type[Model], str], Tuple[Type[User], str]]: ...
def get_fields_from_path(model: Type[Model], path: str) -> Any: ... def get_fields_from_path(model: Type[Model], path: str) -> Any: ...
def construct_change_message(form: AdminPasswordChangeForm, formsets: None, add: bool) -> List[Dict[str, Dict[str, List[str]]]]: ... def construct_change_message(
form: AdminPasswordChangeForm, formsets: None, add: bool
) -> List[Dict[str, Dict[str, List[str]]]]: ...

View File

@@ -9,6 +9,7 @@ from django.core.handlers.wsgi import WSGIRequest
from django.core.paginator import Paginator from django.core.paginator import Paginator
from django.db.models.query import QuerySet from django.db.models.query import QuerySet
from django.http.response import JsonResponse from django.http.response import JsonResponse
class AutocompleteJsonView(BaseListView): class AutocompleteJsonView(BaseListView):
paginate_by: int = ... paginate_by: int = ...
model_admin: Any = ... model_admin: Any = ...

View File

@@ -5,4 +5,7 @@
from typing import Any, Optional from typing import Any, Optional
from typing import Callable from typing import Callable
def staff_member_required(view_func: None = ..., redirect_field_name: str = ..., login_url: str = ...) -> Callable: ...
def staff_member_required(
view_func: None = ..., redirect_field_name: str = ..., login_url: str = ...
) -> Callable: ...

View File

@@ -12,6 +12,7 @@ from django.db.models.base import Model
from django.db.models.expressions import CombinedExpression from django.db.models.expressions import CombinedExpression
from django.db.models.query import QuerySet from django.db.models.query import QuerySet
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
ALL_VAR: str ALL_VAR: str
ORDER_VAR: str ORDER_VAR: str
ORDER_TYPE_VAR: str ORDER_TYPE_VAR: str
@@ -46,10 +47,29 @@ class ChangeList:
queryset: Any = ... queryset: Any = ...
title: Any = ... title: Any = ...
pk_attname: Any = ... pk_attname: Any = ...
def __init__(self, request: WSGIRequest, model: Type[Model], list_display: Union[List[str], List[Union[str, Callable]], Tuple[str, str, str, str]], list_display_links: Union[List[str], Tuple[str, str]], list_filter: Union[List[Type[SimpleListFilter]], List[str], Tuple], date_hierarchy: Optional[str], search_fields: Union[List[str], Tuple], list_select_related: bool, list_per_page: int, list_max_show_all: int, list_editable: Union[List[str], Tuple], model_admin: ModelAdmin, sortable_by: Any) -> None: ... def __init__(
self,
request: WSGIRequest,
model: Type[Model],
list_display: Union[
List[str], List[Union[str, Callable]], Tuple[str, str, str, str]
],
list_display_links: Union[List[str], Tuple[str, str]],
list_filter: Union[List[Type[SimpleListFilter]], List[str], Tuple],
date_hierarchy: Optional[str],
search_fields: Union[List[str], Tuple],
list_select_related: bool,
list_per_page: int,
list_max_show_all: int,
list_editable: Union[List[str], Tuple],
model_admin: ModelAdmin,
sortable_by: Any,
) -> None: ...
def get_filters_params(self, params: None = ...) -> Dict[str, str]: ... def get_filters_params(self, params: None = ...) -> Dict[str, str]: ...
def get_filters(self, request: WSGIRequest) -> Any: ... def get_filters(self, request: WSGIRequest) -> Any: ...
def get_query_string(self, new_params: Any = ..., remove: Optional[List[str]] = ...) -> str: ... def get_query_string(
self, new_params: Any = ..., remove: Optional[List[str]] = ...
) -> str: ...
result_count: Any = ... result_count: Any = ...
show_full_result_count: Any = ... show_full_result_count: Any = ...
show_admin_actions: Any = ... show_admin_actions: Any = ...
@@ -60,7 +80,9 @@ class ChangeList:
paginator: Any = ... paginator: Any = ...
def get_results(self, request: WSGIRequest) -> None: ... def get_results(self, request: WSGIRequest) -> None: ...
def _get_default_ordering(self) -> Union[List[str], Tuple[str], Tuple[str, str]]: ... def _get_default_ordering(self) -> Union[List[str], Tuple[str], Tuple[str, str]]: ...
def get_ordering_field(self, field_name: Union[str, Callable]) -> Optional[Union[str, CombinedExpression]]: ... def get_ordering_field(
self, field_name: Union[str, Callable]
) -> Optional[Union[str, CombinedExpression]]: ...
def get_ordering(self, request: WSGIRequest, queryset: QuerySet) -> List[str]: ... def get_ordering(self, request: WSGIRequest, queryset: QuerySet) -> List[str]: ...
def get_ordering_field_columns(self) -> OrderedDict: ... def get_ordering_field_columns(self) -> OrderedDict: ...
def get_queryset(self, request: WSGIRequest) -> QuerySet: ... def get_queryset(self, request: WSGIRequest) -> QuerySet: ...

View File

@@ -12,12 +12,15 @@ from django.forms.widgets import Media, Select
from django.http.request import QueryDict from django.http.request import QueryDict
from django.utils.datastructures import MultiValueDict from django.utils.datastructures import MultiValueDict
from typing import Any, Dict, List, Optional, Set, Tuple, Union from typing import Any, Dict, List, Optional, Set, Tuple, Union
class FilteredSelectMultiple(forms.SelectMultiple): class FilteredSelectMultiple(forms.SelectMultiple):
@property @property
def media(self) -> Media: ... def media(self) -> Media: ...
verbose_name: Any = ... verbose_name: Any = ...
is_stacked: Any = ... is_stacked: Any = ...
def __init__(self, verbose_name: str, is_stacked: bool, attrs: None = ..., choices: Tuple = ...) -> None: ... def __init__(
self, verbose_name: str, is_stacked: bool, attrs: None = ..., choices: Tuple = ...
) -> None: ...
def get_context(self, name: Any, value: Any, attrs: Any): ... def get_context(self, name: Any, value: Any, attrs: Any): ...
class AdminDateWidget(forms.DateInput): class AdminDateWidget(forms.DateInput):
@@ -33,7 +36,33 @@ class AdminTimeWidget(forms.TimeInput):
class AdminSplitDateTime(forms.SplitDateTimeWidget): class AdminSplitDateTime(forms.SplitDateTimeWidget):
template_name: str = ... template_name: str = ...
def __init__(self, attrs: None = ...) -> None: ... def __init__(self, attrs: None = ...) -> None: ...
def get_context(self, name: str, value: Optional[datetime], attrs: Dict[str, Union[bool, str]]) -> Dict[str, Union[Dict[str, Any], str, Dict[str, Union[str, bool, Dict[str, Union[bool, str]], List[Dict[str, Union[str, bool, Dict[str, Union[bool, str]]]]]]], Dict[str, Union[str, bool, Dict[str, str], List[Dict[str, Union[str, bool, Dict[str, str]]]]]]]]: ... def get_context(
self, name: str, value: Optional[datetime], attrs: Dict[str, Union[bool, str]]
) -> Dict[
str,
Union[
Dict[str, Any],
str,
Dict[
str,
Union[
str,
bool,
Dict[str, Union[bool, str]],
List[Dict[str, Union[str, bool, Dict[str, Union[bool, str]]]]],
],
],
Dict[
str,
Union[
str,
bool,
Dict[str, str],
List[Dict[str, Union[str, bool, Dict[str, str]]]],
],
],
],
]: ...
class AdminRadioSelect(forms.RadioSelect): class AdminRadioSelect(forms.RadioSelect):
template_name: str = ... template_name: str = ...
@@ -48,8 +77,14 @@ class ForeignKeyRawIdWidget(forms.TextInput):
rel: Any = ... rel: Any = ...
admin_site: Any = ... admin_site: Any = ...
db: Any = ... db: Any = ...
def __init__(self, rel: ManyToOneRel, admin_site: AdminSite, attrs: None = ..., using: None = ...) -> None: ... def __init__(
def get_context(self, name: str, value: None, attrs: Dict[str, Union[bool, str]]) -> Dict[str, Union[Dict[str, Union[str, bool, None, Dict[str, Union[bool, str]]]], str]]: ... self, rel: ManyToOneRel, admin_site: AdminSite, attrs: None = ..., using: None = ...
) -> None: ...
def get_context(
self, name: str, value: None, attrs: Dict[str, Union[bool, str]]
) -> Dict[
str, Union[Dict[str, Union[str, bool, None, Dict[str, Union[bool, str]]]], str]
]: ...
def base_url_parameters(self) -> Dict[str, str]: ... def base_url_parameters(self) -> Dict[str, str]: ...
def url_parameters(self) -> Dict[str, str]: ... def url_parameters(self) -> Dict[str, str]: ...
def label_and_url_for_value(self, value: Any): ... def label_and_url_for_value(self, value: Any): ...
@@ -74,15 +109,28 @@ class RelatedFieldWidgetWrapper(forms.Widget):
can_delete_related: Any = ... can_delete_related: Any = ...
can_view_related: Any = ... can_view_related: Any = ...
admin_site: Any = ... admin_site: Any = ...
def __init__(self, widget: Union[Select, AdminRadioSelect], rel: ForeignObjectRel, admin_site: AdminSite, can_add_related: Optional[bool] = ..., can_change_related: bool = ..., can_delete_related: bool = ..., can_view_related: bool = ...) -> None: ... def __init__(
self,
widget: Union[Select, AdminRadioSelect],
rel: ForeignObjectRel,
admin_site: AdminSite,
can_add_related: Optional[bool] = ...,
can_change_related: bool = ...,
can_delete_related: bool = ...,
can_view_related: bool = ...,
) -> None: ...
def __deepcopy__(self, memo: Dict[int, Any]) -> RelatedFieldWidgetWrapper: ... def __deepcopy__(self, memo: Dict[int, Any]) -> RelatedFieldWidgetWrapper: ...
@property @property
def is_hidden(self) -> bool: ... def is_hidden(self) -> bool: ...
@property @property
def media(self) -> Media: ... def media(self) -> Media: ...
def get_related_url(self, info: Tuple[str, str], action: str, *args: Any) -> str: ... def get_related_url(self, info: Tuple[str, str], action: str, *args: Any) -> str: ...
def get_context(self, name: str, value: Optional[Union[str, int]], attrs: Dict[str, str]) -> Dict[str, Union[bool, str]]: ... def get_context(
def value_from_datadict(self, data: QueryDict, files: MultiValueDict, name: str) -> Optional[str]: ... self, name: str, value: Optional[Union[str, int]], attrs: Dict[str, str]
) -> Dict[str, Union[bool, str]]: ...
def value_from_datadict(
self, data: QueryDict, files: MultiValueDict, name: str
) -> Optional[str]: ...
def value_omitted_from_data(self, data: Any, files: Any, name: Any): ... def value_omitted_from_data(self, data: Any, files: Any, name: Any): ...
def id_for_label(self, id_: str) -> str: ... def id_for_label(self, id_: str) -> str: ...
@@ -98,7 +146,9 @@ class AdminEmailInputWidget(forms.EmailInput):
class AdminURLFieldWidget(forms.URLInput): class AdminURLFieldWidget(forms.URLInput):
template_name: str = ... template_name: str = ...
def __init__(self, attrs: None = ...) -> None: ... def __init__(self, attrs: None = ...) -> None: ...
def get_context(self, name: str, value: None, attrs: Dict[str, str]) -> Dict[str, Union[Dict[str, Union[str, bool, None, Dict[str, str]]], str]]: ... def get_context(
self, name: str, value: None, attrs: Dict[str, str]
) -> Dict[str, Union[Dict[str, Union[str, bool, None, Dict[str, str]]], str]]: ...
class AdminIntegerFieldWidget(forms.NumberInput): class AdminIntegerFieldWidget(forms.NumberInput):
class_name: str = ... class_name: str = ...
@@ -116,10 +166,24 @@ class AutocompleteMixin:
db: Any = ... db: Any = ...
choices: Any = ... choices: Any = ...
attrs: Any = ... attrs: Any = ...
def __init__(self, rel: ManyToOneRel, admin_site: AdminSite, attrs: None = ..., choices: Tuple = ..., using: None = ...) -> None: ... def __init__(
self,
rel: ManyToOneRel,
admin_site: AdminSite,
attrs: None = ...,
choices: Tuple = ...,
using: None = ...,
) -> None: ...
def get_url(self) -> str: ... def get_url(self) -> str: ...
def build_attrs(self, base_attrs: Dict[Any, Any], extra_attrs: Dict[str, str] = ...) -> Dict[str, str]: ... def build_attrs(
def optgroups(self, name: str, value: List[str], attr: Dict[str, str] = ...) -> Union[List[Tuple[None, List[Dict[str, Union[str, int, Set[str], Dict[str, bool]]]], int]], List[Tuple[None, List[Dict[str, Union[bool, str]]], int]]]: ... self, base_attrs: Dict[Any, Any], extra_attrs: Dict[str, str] = ...
) -> Dict[str, str]: ...
def optgroups(
self, name: str, value: List[str], attr: Dict[str, str] = ...
) -> Union[
List[Tuple[None, List[Dict[str, Union[str, int, Set[str], Dict[str, bool]]]], int]],
List[Tuple[None, List[Dict[str, Union[bool, str]]], int]],
]: ...
@property @property
def media(self) -> Media: ... def media(self) -> Media: ...

View File

@@ -9,5 +9,12 @@ from typing import Any
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
from django.http.response import HttpResponse from django.http.response import HttpResponse
from typing import Any, Callable, Dict, Optional, Tuple from typing import Any, Callable, Dict, Optional, Tuple
class XViewMiddleware(MiddlewareMixin): class XViewMiddleware(MiddlewareMixin):
def process_view(self, request: WSGIRequest, view_func: Callable, view_args: Tuple, view_kwargs: Dict[Any, Any]) -> Optional[HttpResponse]: ... def process_view(
self,
request: WSGIRequest,
view_func: Callable,
view_args: Tuple,
view_kwargs: Dict[Any, Any],
) -> Optional[HttpResponse]: ...

View File

@@ -5,17 +5,28 @@
from typing import Any, Optional from typing import Any, Optional
from typing import Callable from typing import Callable
docutils_is_available: bool docutils_is_available: bool
def get_view_name(view_func: Callable) -> str: ... def get_view_name(view_func: Callable) -> str: ...
def trim_docstring(docstring: Any): ... def trim_docstring(docstring: Any): ...
def parse_docstring(docstring: Any): ... def parse_docstring(docstring: Any): ...
def parse_rst(text: Any, default_reference_context: Any, thing_being_parsed: Optional[Any] = ...): ... def parse_rst(
text: Any, default_reference_context: Any, thing_being_parsed: Optional[Any] = ...
): ...
ROLES: Any ROLES: Any
def create_reference_role(rolename: Any, urlbase: Any): ... def create_reference_role(rolename: Any, urlbase: Any): ...
def default_reference_role(name: Any, rawtext: Any, text: Any, lineno: Any, inliner: Any, options: Optional[Any] = ..., content: Optional[Any] = ...): ... def default_reference_role(
name: Any,
rawtext: Any,
text: Any,
lineno: Any,
inliner: Any,
options: Optional[Any] = ...,
content: Optional[Any] = ...,
): ...
named_group_matcher: Any named_group_matcher: Any
unnamed_group_matcher: Any unnamed_group_matcher: Any

View File

@@ -7,6 +7,7 @@ from django.views.generic import TemplateView
from typing import Any, Optional from typing import Any, Optional
from django.db.models.fields import Field from django.db.models.fields import Field
MODEL_METHODS_EXCLUDE: Any MODEL_METHODS_EXCLUDE: Any
class BaseAdminDocsView(TemplateView): class BaseAdminDocsView(TemplateView):
@@ -50,5 +51,7 @@ class TemplateDetailView(BaseAdminDocsView):
def get_return_data_type(func_name: Any): ... def get_return_data_type(func_name: Any): ...
def get_readable_field_data_type(field: Field) -> str: ... def get_readable_field_data_type(field: Field) -> str: ...
def extract_views_from_urlpatterns(urlpatterns: Any, base: str = ..., namespace: Optional[Any] = ...): ... def extract_views_from_urlpatterns(
urlpatterns: Any, base: str = ..., namespace: Optional[Any] = ...
): ...
def simplify_regex(pattern: Any): ... def simplify_regex(pattern: Any): ...

View File

@@ -14,6 +14,7 @@ from django.db.models.options import Options
from django.http.request import HttpRequest from django.http.request import HttpRequest
from django.utils.functional import SimpleLazyObject from django.utils.functional import SimpleLazyObject
from typing import Any, Dict, List, Optional, Type, Union from typing import Any, Dict, List, Optional, Type, Union
SESSION_KEY: str SESSION_KEY: str
BACKEND_SESSION_KEY: str BACKEND_SESSION_KEY: str
HASH_SESSION_KEY: str HASH_SESSION_KEY: str
@@ -22,10 +23,18 @@ REDIRECT_FIELD_NAME: str
def load_backend(path: str) -> object: ... def load_backend(path: str) -> object: ...
def _get_backends(return_tuples: bool = ...) -> Any: ... def _get_backends(return_tuples: bool = ...) -> Any: ...
def get_backends() -> List[ModelBackend]: ... def get_backends() -> List[ModelBackend]: ...
def _clean_credentials(credentials: Dict[str, Optional[str]]) -> Dict[str, Optional[str]]: ... def _clean_credentials(
credentials: Dict[str, Optional[str]]
) -> Dict[str, Optional[str]]: ...
def _get_user_session_key(request: HttpRequest) -> int: ... def _get_user_session_key(request: HttpRequest) -> int: ...
def authenticate(request: Optional[HttpRequest] = ..., **credentials: Any) -> Optional[AbstractBaseUser]: ... def authenticate(
def login(request: HttpRequest, user: User, backend: Optional[Union[str, Type[ModelBackend]]] = ...) -> None: ... request: Optional[HttpRequest] = ..., **credentials: Any
) -> Optional[AbstractBaseUser]: ...
def login(
request: HttpRequest,
user: User,
backend: Optional[Union[str, Type[ModelBackend]]] = ...,
) -> None: ...
def logout(request: HttpRequest) -> None: ... def logout(request: HttpRequest) -> None: ...
def get_user_model() -> Type[Model]: ... def get_user_model() -> Type[Model]: ...
def get_user(request: HttpRequest) -> Union[AnonymousUser, AbstractBaseUser]: ... def get_user(request: HttpRequest) -> Union[AnonymousUser, AbstractBaseUser]: ...

View File

@@ -5,52 +5,28 @@ from django.forms.models import ModelMultipleChoiceField
from django.http.response import HttpResponseRedirect from django.http.response import HttpResponseRedirect
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.urls.resolvers import URLPattern from django.urls.resolvers import URLPattern
from typing import ( from typing import Dict, List, Tuple, Union
Dict,
List,
Tuple,
Union,
)
class GroupAdmin: class GroupAdmin:
def formfield_for_manytomany( def formfield_for_manytomany(
self, self, db_field: ManyToManyField, request: WSGIRequest = ..., **kwargs
db_field: ManyToManyField,
request: WSGIRequest = ...,
**kwargs
) -> ModelMultipleChoiceField: ... ) -> ModelMultipleChoiceField: ...
class UserAdmin: class UserAdmin:
def _add_view( def _add_view(
self, self, request: WSGIRequest, form_url: str = ..., extra_context: None = ...
request: WSGIRequest,
form_url: str = ...,
extra_context: None = ...
) -> Union[TemplateResponse, HttpResponseRedirect]: ... ) -> Union[TemplateResponse, HttpResponseRedirect]: ...
def add_view( def add_view(
self, self, request: WSGIRequest, form_url: str = ..., extra_context: None = ...
request: WSGIRequest,
form_url: str = ...,
extra_context: None = ...
): ... ): ...
def get_fieldsets( def get_fieldsets(
self, self, request: WSGIRequest, obj: None = ...
request: WSGIRequest,
obj: None = ...
) -> Tuple[Tuple[None, Dict[str, Union[Tuple[str], Tuple[str, str, str]]]]]: ... ) -> Tuple[Tuple[None, Dict[str, Union[Tuple[str], Tuple[str, str, str]]]]]: ...
def get_urls(self) -> List[URLPattern]: ... def get_urls(self) -> List[URLPattern]: ...
def lookup_allowed(self, lookup: str, value: str) -> bool: ... def lookup_allowed(self, lookup: str, value: str) -> bool: ...
def response_add( def response_add(
self, self, request: WSGIRequest, obj: User, post_url_continue: None = ...
request: WSGIRequest,
obj: User,
post_url_continue: None = ...
) -> HttpResponseRedirect: ... ) -> HttpResponseRedirect: ...
def user_change_password( def user_change_password(
self, self, request: WSGIRequest, id: str, form_url: str = ...
request: WSGIRequest,
id: str,
form_url: str = ...
) -> Union[TemplateResponse, HttpResponseRedirect]: ... ) -> Union[TemplateResponse, HttpResponseRedirect]: ...

View File

@@ -1,26 +1,16 @@
from django.contrib.auth.base_user import AbstractBaseUser from django.contrib.auth.base_user import AbstractBaseUser
from django.contrib.auth.models import ( from django.contrib.auth.models import AnonymousUser, User
AnonymousUser,
User,
)
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
from django.db.models.query import QuerySet from django.db.models.query import QuerySet
from django.http.request import HttpRequest from django.http.request import HttpRequest
from typing import ( from typing import Optional, Set, Union
Optional,
Set,
Union,
)
class AllowAllUsersModelBackend: class AllowAllUsersModelBackend:
def user_can_authenticate(self, user: User) -> bool: ... def user_can_authenticate(self, user: User) -> bool: ...
class AllowAllUsersRemoteUserBackend: class AllowAllUsersRemoteUserBackend:
def user_can_authenticate(self, user: User) -> bool: ... def user_can_authenticate(self, user: User) -> bool: ...
class ModelBackend: class ModelBackend:
def _get_group_permissions(self, user_obj: User) -> QuerySet: ... def _get_group_permissions(self, user_obj: User) -> QuerySet: ...
def _get_permissions(self, user_obj: User, obj: None, from_name: str) -> Set[str]: ... def _get_permissions(self, user_obj: User, obj: None, from_name: str) -> Set[str]: ...
@@ -30,31 +20,23 @@ class ModelBackend:
request: Optional[HttpRequest], request: Optional[HttpRequest],
username: Optional[str] = ..., username: Optional[str] = ...,
password: Optional[str] = ..., password: Optional[str] = ...,
**kwargs **kwargs,
) -> Optional[User]: ... ) -> Optional[User]: ...
def get_all_permissions(self, user_obj: User, obj: Optional[str] = ...) -> Set[str]: ... def get_all_permissions(self, user_obj: User, obj: Optional[str] = ...) -> Set[str]: ...
def get_group_permissions(self, user_obj: User, obj: None = ...) -> Set[str]: ... def get_group_permissions(self, user_obj: User, obj: None = ...) -> Set[str]: ...
def get_user(self, user_id: int) -> User: ... def get_user(self, user_id: int) -> User: ...
def get_user_permissions(self, user_obj: User, obj: None = ...) -> Set[str]: ... def get_user_permissions(self, user_obj: User, obj: None = ...) -> Set[str]: ...
def has_module_perms( def has_module_perms(
self, self, user_obj: Union[AnonymousUser, User], app_label: str
user_obj: Union[AnonymousUser, User],
app_label: str
) -> bool: ... ) -> bool: ...
def has_perm( def has_perm(
self, self, user_obj: Union[AnonymousUser, User], perm: str, obj: None = ...
user_obj: Union[AnonymousUser, User],
perm: str,
obj: None = ...
) -> bool: ... ) -> bool: ...
def user_can_authenticate(self, user: Optional[AbstractBaseUser]) -> bool: ... def user_can_authenticate(self, user: Optional[AbstractBaseUser]) -> bool: ...
class RemoteUserBackend: class RemoteUserBackend:
def authenticate( def authenticate(
self, self, request: WSGIRequest, remote_user: Optional[str]
request: WSGIRequest,
remote_user: Optional[str]
) -> Optional[User]: ... ) -> Optional[User]: ...
def clean_username(self, username: str) -> str: ... def clean_username(self, username: str) -> str: ...
def configure_user(self, user: User) -> User: ... def configure_user(self, user: User) -> User: ...

View File

@@ -1,6 +1,5 @@
from typing import Optional from typing import Optional
class AbstractBaseUser: class AbstractBaseUser:
def __str__(self) -> str: ... def __str__(self) -> str: ...
def check_password(self, raw_password: str) -> bool: ... def check_password(self, raw_password: str) -> bool: ...
@@ -20,7 +19,6 @@ class AbstractBaseUser:
def set_password(self, raw_password: Optional[str]) -> None: ... def set_password(self, raw_password: Optional[str]) -> None: ...
def set_unusable_password(self) -> None: ... def set_unusable_password(self) -> None: ...
class BaseUserManager: class BaseUserManager:
def get_by_natural_key(self, username: Optional[str]) -> AbstractBaseUser: ... def get_by_natural_key(self, username: Optional[str]) -> AbstractBaseUser: ...
@classmethod @classmethod

View File

@@ -6,5 +6,6 @@ from .management import _get_builtin_permissions
from typing import Any, Optional from typing import Any, Optional
from typing import Any, List from typing import Any, List
def check_user_model(app_configs: None = ..., **kwargs: Any) -> List[Any]: ... def check_user_model(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
def check_models_permissions(app_configs: None = ..., **kwargs: Any) -> List[Any]: ... def check_models_permissions(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...

View File

@@ -7,6 +7,7 @@ from typing import Any
from django.contrib.auth.models import AnonymousUser, User from django.contrib.auth.models import AnonymousUser, User
from django.http.request import HttpRequest from django.http.request import HttpRequest
from typing import Dict, Union from typing import Dict, Union
class PermLookupDict: class PermLookupDict:
def __init__(self, user: object, app_label: str) -> None: ... def __init__(self, user: object, app_label: str) -> None: ...
def __repr__(self): ... def __repr__(self): ...

View File

@@ -5,6 +5,15 @@
from typing import Any, Optional from typing import Any, Optional
from typing import Callable, List, Optional, Union from typing import Callable, List, Optional, Union
def user_passes_test(test_func: Callable, login_url: Optional[str] = ..., redirect_field_name: str = ...) -> Callable: ...
def login_required(function: Optional[Callable] = ..., redirect_field_name: str = ..., login_url: None = ...) -> Callable: ... def user_passes_test(
def permission_required(perm: Union[str, List[str]], login_url: None = ..., raise_exception: bool = ...) -> Callable: ... test_func: Callable, login_url: Optional[str] = ..., redirect_field_name: str = ...
) -> Callable: ...
def login_required(
function: Optional[Callable] = ...,
redirect_field_name: str = ...,
login_url: None = ...,
) -> Callable: ...
def permission_required(
perm: Union[str, List[str]], login_url: None = ..., raise_exception: bool = ...
) -> Callable: ...

View File

@@ -2,15 +2,7 @@ from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
from typing import ( from typing import Any, Dict, Iterator, List, Optional, Union
Any,
Dict,
Iterator,
List,
Optional,
Union,
)
class AdminPasswordChangeForm: class AdminPasswordChangeForm:
def __init__(self, user: User, *args, **kwargs) -> None: ... def __init__(self, user: User, *args, **kwargs) -> None: ...
@@ -19,7 +11,6 @@ class AdminPasswordChangeForm:
def clean_password2(self) -> str: ... def clean_password2(self) -> str: ...
def save(self, commit: bool = ...) -> User: ... def save(self, commit: bool = ...) -> User: ...
class AuthenticationForm: class AuthenticationForm:
def __init__(self, request: object = ..., *args, **kwargs) -> None: ... def __init__(self, request: object = ..., *args, **kwargs) -> None: ...
def clean(self) -> Dict[str, str]: ... def clean(self) -> Dict[str, str]: ...
@@ -27,11 +18,9 @@ class AuthenticationForm:
def get_invalid_login_error(self) -> ValidationError: ... def get_invalid_login_error(self) -> ValidationError: ...
def get_user(self) -> User: ... def get_user(self) -> User: ...
class PasswordChangeForm: class PasswordChangeForm:
def clean_old_password(self) -> str: ... def clean_old_password(self) -> str: ...
class PasswordResetForm: class PasswordResetForm:
def get_users(self, email: str) -> Iterator[Any]: ... def get_users(self, email: str) -> Iterator[Any]: ...
def save( def save(
@@ -44,7 +33,7 @@ class PasswordResetForm:
from_email: None = ..., from_email: None = ...,
request: Optional[WSGIRequest] = ..., request: Optional[WSGIRequest] = ...,
html_email_template_name: None = ..., html_email_template_name: None = ...,
extra_email_context: Optional[Dict[str, str]] = ... extra_email_context: Optional[Dict[str, str]] = ...,
) -> None: ... ) -> None: ...
def send_mail( def send_mail(
self, self,
@@ -53,41 +42,34 @@ class PasswordResetForm:
context: Dict[str, Union[str, User]], context: Dict[str, Union[str, User]],
from_email: Optional[str], from_email: Optional[str],
to_email: str, to_email: str,
html_email_template_name: None = ... html_email_template_name: None = ...,
) -> None: ... ) -> None: ...
class ReadOnlyPasswordHashField: class ReadOnlyPasswordHashField:
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
def has_changed(self, initial: str, data: None) -> bool: ... def has_changed(self, initial: str, data: None) -> bool: ...
class ReadOnlyPasswordHashWidget: class ReadOnlyPasswordHashWidget:
def get_context( def get_context(
self, self, name: str, value: str, attrs: Dict[str, str]
name: str, ) -> Dict[
value: str, str, Union[Dict[str, Union[str, bool, Dict[str, str]]], List[Dict[str, str]]]
attrs: Dict[str, str] ]: ...
) -> Dict[str, Union[Dict[str, Union[str, bool, Dict[str, str]]], List[Dict[str, str]]]]: ...
class SetPasswordForm: class SetPasswordForm:
def __init__(self, user: Optional[User], *args, **kwargs) -> None: ... def __init__(self, user: Optional[User], *args, **kwargs) -> None: ...
def clean_new_password2(self) -> str: ... def clean_new_password2(self) -> str: ...
def save(self, commit: bool = ...) -> User: ... def save(self, commit: bool = ...) -> User: ...
class UserChangeForm: class UserChangeForm:
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
def clean_password(self) -> str: ... def clean_password(self) -> str: ...
class UserCreationForm: class UserCreationForm:
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
def _post_clean(self) -> None: ... def _post_clean(self) -> None: ...
def clean_password2(self) -> str: ... def clean_password2(self) -> str: ...
def save(self, commit: bool = ...) -> User: ... def save(self, commit: bool = ...) -> User: ...
class UsernameField: class UsernameField:
def to_python(self, value: Optional[str]) -> str: ... def to_python(self, value: Optional[str]) -> str: ...

View File

@@ -1,10 +1,4 @@
from typing import ( from typing import Any, Dict
Any,
Dict,
)
def check_password(environ: Dict[Any, Any], username: str, password: str): ... def check_password(environ: Dict[Any, Any], username: str, password: str): ...
def groups_for_user(environ: Dict[Any, Any], username: str): ... def groups_for_user(environ: Dict[Any, Any], username: str): ...

View File

@@ -6,13 +6,23 @@ from typing import Any, Optional
from collections import OrderedDict from collections import OrderedDict
from typing import Callable, Dict, List, Optional, Union from typing import Callable, Dict, List, Optional, Union
UNUSABLE_PASSWORD_PREFIX: str UNUSABLE_PASSWORD_PREFIX: str
UNUSABLE_PASSWORD_SUFFIX_LENGTH: int UNUSABLE_PASSWORD_SUFFIX_LENGTH: int
def is_password_usable(encoded: Optional[str]) -> bool: ... def is_password_usable(encoded: Optional[str]) -> bool: ...
def check_password(password: str, encoded: str, setter: Optional[Callable] = ..., preferred: str = ...) -> bool: ... def check_password(
def make_password(password: Optional[str], salt: Optional[str] = ..., hasher: str = ...) -> str: ... password: str, encoded: str, setter: Optional[Callable] = ..., preferred: str = ...
def get_hashers() -> Union[List[UnsaltedMD5PasswordHasher], List[MD5PasswordHasher], List[BasePasswordHasher], List[PBKDF2PasswordHasher]]: ... ) -> bool: ...
def make_password(
password: Optional[str], salt: Optional[str] = ..., hasher: str = ...
) -> str: ...
def get_hashers() -> Union[
List[UnsaltedMD5PasswordHasher],
List[MD5PasswordHasher],
List[BasePasswordHasher],
List[PBKDF2PasswordHasher],
]: ...
def get_hashers_by_algorithm() -> Dict[str, BasePasswordHasher]: ... def get_hashers_by_algorithm() -> Dict[str, BasePasswordHasher]: ...
def reset_hashers(**kwargs: Any) -> None: ... def reset_hashers(**kwargs: Any) -> None: ...
def get_hasher(algorithm: str = ...) -> BasePasswordHasher: ... def get_hasher(algorithm: str = ...) -> BasePasswordHasher: ...

View File

@@ -8,8 +8,16 @@ from django.apps.config import AppConfig
from django.apps.registry import Apps from django.apps.registry import Apps
from django.db.models.options import Options from django.db.models.options import Options
from typing import List, Tuple from typing import List, Tuple
def _get_all_permissions(opts: Options) -> List[Tuple[str, str]]: ... def _get_all_permissions(opts: Options) -> List[Tuple[str, str]]: ...
def _get_builtin_permissions(opts: Options) -> List[Tuple[str, str]]: ... def _get_builtin_permissions(opts: Options) -> List[Tuple[str, str]]: ...
def create_permissions(app_config: AppConfig, verbosity: int = ..., interactive: bool = ..., using: str = ..., apps: Apps = ..., **kwargs: Any) -> None: ... def create_permissions(
app_config: AppConfig,
verbosity: int = ...,
interactive: bool = ...,
using: str = ...,
apps: Apps = ...,
**kwargs: Any,
) -> None: ...
def get_system_username() -> str: ... def get_system_username() -> str: ...
def get_default_username(check_db: bool = ...) -> str: ... def get_default_username(check_db: bool = ...) -> str: ...

View File

@@ -1,6 +1,5 @@
from django.core.management.base import CommandParser from django.core.management.base import CommandParser
class Command: class Command:
def add_arguments(self, parser: CommandParser) -> None: ... def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, *args, **options) -> str: ... def handle(self, *args, **options) -> str: ...

View File

@@ -1,11 +1,7 @@
from django.core.management.base import CommandParser from django.core.management.base import CommandParser
from django.db.models.fields import CharField from django.db.models.fields import CharField
from django.db.models.fields.related import ForeignKey from django.db.models.fields.related import ForeignKey
from typing import ( from typing import Optional, Union
Optional,
Union,
)
class Command: class Command:
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
@@ -15,6 +11,6 @@ class Command:
self, self,
field: Union[CharField, related.ForeignKey], field: Union[CharField, related.ForeignKey],
message: str, message: str,
default: Optional[str] = ... default: Optional[str] = ...,
) -> Optional[str]: ... ) -> Optional[str]: ...
def handle(self, *args, **options) -> None: ... def handle(self, *args, **options) -> None: ...

View File

@@ -1,21 +1,13 @@
from django.contrib.auth.models import ( from django.contrib.auth.models import AnonymousUser, User
AnonymousUser,
User,
)
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
from django.http.request import HttpRequest from django.http.request import HttpRequest
from typing import Union from typing import Union
def get_user(request: HttpRequest) -> Union[AnonymousUser, User]: ...
def get_user(
request: HttpRequest
) -> Union[AnonymousUser, User]: ...
class AuthenticationMiddleware: class AuthenticationMiddleware:
def process_request(self, request: HttpRequest) -> None: ... def process_request(self, request: HttpRequest) -> None: ...
class RemoteUserMiddleware: class RemoteUserMiddleware:
def _remove_invalid_user(self, request: WSGIRequest) -> None: ... def _remove_invalid_user(self, request: WSGIRequest) -> None: ...
def clean_username(self, username: str, request: WSGIRequest) -> str: ... def clean_username(self, username: str, request: WSGIRequest) -> str: ...

View File

@@ -1,30 +1,18 @@
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
from django.http.response import HttpResponse from django.http.response import HttpResponse
from typing import ( from typing import Callable, List
Callable,
List,
)
class AccessMixin: class AccessMixin:
def get_permission_denied_message(self) -> str: ... def get_permission_denied_message(self) -> str: ...
def get_redirect_field_name(self) -> str: ... def get_redirect_field_name(self) -> str: ...
def handle_no_permission(self): ... def handle_no_permission(self): ...
class LoginRequiredMixin: class LoginRequiredMixin:
def dispatch(self, request: WSGIRequest, *args, **kwargs): ... def dispatch(self, request: WSGIRequest, *args, **kwargs): ...
class PermissionRequiredMixin: class PermissionRequiredMixin:
def dispatch( def dispatch(self, request: WSGIRequest, *args, **kwargs) -> HttpResponse: ...
self,
request: WSGIRequest,
*args,
**kwargs
) -> HttpResponse: ...
def get_permission_required(self) -> List[str]: ... def get_permission_required(self) -> List[str]: ...
class UserPassesTestMixin: class UserPassesTestMixin:
def get_test_func(self) -> Callable: ... def get_test_func(self) -> Callable: ...

View File

@@ -1,98 +1,65 @@
from typing import ( from typing import List, Optional, Set, Tuple, Type, Union
List,
Optional,
Set,
Tuple,
Type,
Union,
)
def _user_get_all_permissions(user: User, obj: Optional[str]) -> Set[str]: ... def _user_get_all_permissions(user: User, obj: Optional[str]) -> Set[str]: ...
def _user_has_module_perms(user: Union[AnonymousUser, User], app_label: str) -> bool: ...
def _user_has_module_perms(
user: Union[AnonymousUser, User],
app_label: str
) -> bool: ...
def _user_has_perm( def _user_has_perm(
user: Union[AnonymousUser, User], user: Union[AnonymousUser, User], perm: str, obj: Optional[str]
perm: str,
obj: Optional[str]
) -> bool: ... ) -> bool: ...
def update_last_login(sender: Type[User], user: User, **kwargs) -> None: ...
def update_last_login(
sender: Type[User],
user: User,
**kwargs
) -> None: ...
class AbstractUser: class AbstractUser:
def clean(self) -> None: ... def clean(self) -> None: ...
def get_short_name(self) -> str: ... def get_short_name(self) -> str: ...
class AnonymousUser: class AnonymousUser:
def __str__(self) -> str: ... def __str__(self) -> str: ...
def delete(self): ... def delete(self): ...
def get_username(self) -> str: ... def get_username(self) -> str: ...
def has_module_perms(self, module: str) -> bool: ... def has_module_perms(self, module: str) -> bool: ...
def has_perm(self, perm: str, obj: None = ...) -> bool: ... def has_perm(self, perm: str, obj: None = ...) -> bool: ...
def has_perms(self, perm_list: Union[List[str], Tuple[str]], obj: None = ...) -> bool: ... def has_perms(
self, perm_list: Union[List[str], Tuple[str]], obj: None = ...
) -> bool: ...
@property @property
def is_anonymous(self) -> bool: ... def is_anonymous(self) -> bool: ...
@property @property
def is_authenticated(self) -> bool: ... def is_authenticated(self) -> bool: ...
def set_password(self, raw_password: str): ... def set_password(self, raw_password: str): ...
class Group: class Group:
def __str__(self) -> str: ... def __str__(self) -> str: ...
class GroupManager: class GroupManager:
def get_by_natural_key(self, name: str) -> Group: ... def get_by_natural_key(self, name: str) -> Group: ...
class Permission: class Permission:
def __str__(self) -> str: ... def __str__(self) -> str: ...
def natural_key(self) -> Tuple[str, str, str]: ... def natural_key(self) -> Tuple[str, str, str]: ...
class PermissionManager: class PermissionManager:
def get_by_natural_key(self, codename: str, app_label: str, model: str) -> Permission: ... def get_by_natural_key(
self, codename: str, app_label: str, model: str
) -> Permission: ...
class PermissionsMixin: class PermissionsMixin:
def get_all_permissions(self, obj: None = ...) -> Set[str]: ... def get_all_permissions(self, obj: None = ...) -> Set[str]: ...
def has_module_perms(self, app_label: str) -> bool: ... def has_module_perms(self, app_label: str) -> bool: ...
def has_perm(self, perm: str, obj: None = ...) -> bool: ... def has_perm(self, perm: str, obj: None = ...) -> bool: ...
def has_perms(self, perm_list: Union[List[str], Tuple[str]], obj: None = ...) -> bool: ... def has_perms(
self, perm_list: Union[List[str], Tuple[str]], obj: None = ...
) -> bool: ...
class UserManager: class UserManager:
def _create_user( def _create_user(
self, self, username: str, email: Optional[str], password: Optional[str], **extra_fields
username: str,
email: Optional[str],
password: Optional[str],
**extra_fields
) -> User: ... ) -> User: ...
def create_superuser( def create_superuser(
self, self, username: str, email: str, password: Optional[str], **extra_fields
username: str,
email: str,
password: Optional[str],
**extra_fields
) -> User: ... ) -> User: ...
def create_user( def create_user(
self, self,
username: str, username: str,
email: Optional[str] = ..., email: Optional[str] = ...,
password: Optional[str] = ..., password: Optional[str] = ...,
**extra_fields **extra_fields,
) -> User: ... ) -> User: ...

View File

@@ -8,10 +8,19 @@ from django.contrib.auth.base_user import AbstractBaseUser
from django.contrib.auth.models import User from django.contrib.auth.models import User
from pathlib import PosixPath from pathlib import PosixPath
from typing import Dict, List, Optional, Tuple, Union from typing import Dict, List, Optional, Tuple, Union
def get_default_password_validators() -> Union[List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]]: ...
def get_password_validators(validator_config: List[Dict[str, str]]) -> Union[List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]]: ... def get_default_password_validators() -> Union[
def validate_password(password: str, user: Optional[User] = ..., password_validators: None = ...) -> None: ... List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]
def password_changed(password: str, user: AbstractBaseUser = ..., password_validators: None = ...) -> None: ... ]: ...
def get_password_validators(
validator_config: List[Dict[str, str]]
) -> Union[List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]]: ...
def validate_password(
password: str, user: Optional[User] = ..., password_validators: None = ...
) -> None: ...
def password_changed(
password: str, user: AbstractBaseUser = ..., password_validators: None = ...
) -> None: ...
def password_validators_help_texts(password_validators: None = ...) -> List[str]: ... def password_validators_help_texts(password_validators: None = ...) -> List[str]: ...
def _password_validators_help_text_html(password_validators: None = ...) -> str: ... def _password_validators_help_text_html(password_validators: None = ...) -> str: ...
@@ -27,7 +36,9 @@ class UserAttributeSimilarityValidator:
DEFAULT_USER_ATTRIBUTES: Any = ... DEFAULT_USER_ATTRIBUTES: Any = ...
user_attributes: Any = ... user_attributes: Any = ...
max_similarity: Any = ... max_similarity: Any = ...
def __init__(self, user_attributes: Tuple[str, str, str, str] = ..., max_similarity: float = ...) -> None: ... def __init__(
self, user_attributes: Tuple[str, str, str, str] = ..., max_similarity: float = ...
) -> None: ...
def validate(self, password: str, user: None = ...) -> None: ... def validate(self, password: str, user: None = ...) -> None: ...
def get_help_text(self) -> str: ... def get_help_text(self) -> str: ...

View File

@@ -7,6 +7,7 @@ from typing import Any
from datetime import date from datetime import date
from django.contrib.auth.models import User from django.contrib.auth.models import User
from typing import Optional from typing import Optional
class PasswordResetTokenGenerator: class PasswordResetTokenGenerator:
key_salt: str = ... key_salt: str = ...
secret: Any = ... secret: Any = ...

View File

@@ -10,34 +10,17 @@ from django.http.request import HttpRequest
from django.http.response import HttpResponseRedirect from django.http.response import HttpResponseRedirect
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.utils.datastructures import MultiValueDict from django.utils.datastructures import MultiValueDict
from typing import ( from typing import Any, Dict, Optional, Set, Type, Union
Any,
Dict,
Optional,
Set,
Type,
Union,
)
def redirect_to_login( def redirect_to_login(
next: str, next: str, login_url: Optional[str] = ..., redirect_field_name: Optional[str] = ...
login_url: Optional[str] = ...,
redirect_field_name: Optional[str] = ...
) -> HttpResponseRedirect: ... ) -> HttpResponseRedirect: ...
class LoginView: class LoginView:
def dispatch( def dispatch(
self, self, request: HttpRequest, *args, **kwargs
request: HttpRequest,
*args,
**kwargs
) -> Union[TemplateResponse, HttpResponseRedirect]: ... ) -> Union[TemplateResponse, HttpResponseRedirect]: ...
def form_valid( def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
self,
form: AuthenticationForm
) -> HttpResponseRedirect: ...
def get_context_data(self, **kwargs) -> Dict[str, Any]: ... def get_context_data(self, **kwargs) -> Dict[str, Any]: ...
def get_form_class(self) -> Type[AuthenticationForm]: ... def get_form_class(self) -> Type[AuthenticationForm]: ...
def get_form_kwargs( def get_form_kwargs(
@@ -46,63 +29,36 @@ class LoginView:
def get_redirect_url(self) -> str: ... def get_redirect_url(self) -> str: ...
def get_success_url(self) -> str: ... def get_success_url(self) -> str: ...
class LogoutView: class LogoutView:
def dispatch( def dispatch(
self, self, request: HttpRequest, *args, **kwargs
request: HttpRequest,
*args,
**kwargs
) -> Union[TemplateResponse, HttpResponseRedirect]: ... ) -> Union[TemplateResponse, HttpResponseRedirect]: ...
def get_next_page(self) -> Optional[str]: ... def get_next_page(self) -> Optional[str]: ...
def post( def post(self, request: WSGIRequest, *args, **kwargs) -> TemplateResponse: ...
self,
request: WSGIRequest,
*args,
**kwargs
) -> TemplateResponse: ...
class PasswordChangeDoneView: class PasswordChangeDoneView:
def dispatch(self, *args, **kwargs) -> TemplateResponse: ... def dispatch(self, *args, **kwargs) -> TemplateResponse: ...
class PasswordChangeView: class PasswordChangeView:
def dispatch( def dispatch(
self, self, *args, **kwargs
*args,
**kwargs
) -> Union[TemplateResponse, HttpResponseRedirect]: ... ) -> Union[TemplateResponse, HttpResponseRedirect]: ...
def form_valid( def form_valid(self, form: PasswordChangeForm) -> HttpResponseRedirect: ...
self, def get_form_kwargs(self) -> Dict[str, Optional[Union[MultiValueDict, User]]]: ...
form: PasswordChangeForm
) -> HttpResponseRedirect: ...
def get_form_kwargs(
self
) -> Dict[str, Optional[Union[MultiValueDict, User]]]: ...
class PasswordResetConfirmView: class PasswordResetConfirmView:
def dispatch( def dispatch(
self, self, *args, **kwargs
*args,
**kwargs
) -> Union[TemplateResponse, HttpResponseRedirect]: ... ) -> Union[TemplateResponse, HttpResponseRedirect]: ...
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ... def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
def get_form_kwargs( def get_form_kwargs(self) -> Dict[str, Optional[Union[MultiValueDict, User]]]: ...
self
) -> Dict[str, Optional[Union[MultiValueDict, User]]]: ...
def get_user(self, uidb64: str) -> Optional[User]: ... def get_user(self, uidb64: str) -> Optional[User]: ...
class PasswordResetView: class PasswordResetView:
def dispatch( def dispatch(
self, self, *args, **kwargs
*args,
**kwargs
) -> Union[TemplateResponse, HttpResponseRedirect]: ... ) -> Union[TemplateResponse, HttpResponseRedirect]: ...
def form_valid(self, form: PasswordResetForm) -> HttpResponseRedirect: ... def form_valid(self, form: PasswordResetForm) -> HttpResponseRedirect: ...
class SuccessURLAllowedHostsMixin: class SuccessURLAllowedHostsMixin:
def get_success_url_allowed_hosts(self) -> Set[str]: ... def get_success_url_allowed_hosts(self) -> Set[str]: ...

View File

@@ -1,19 +1,10 @@
from django.db.models.base import Model from django.db.models.base import Model
from typing import ( from typing import Any, List, Type
Any,
List,
Type,
)
class GenericInlineModelAdminChecks: class GenericInlineModelAdminChecks:
def _check_exclude_of_parent_model( def _check_exclude_of_parent_model(
self, self, obj: GenericTabularInline, parent_model: Type[Model]
obj: GenericTabularInline,
parent_model: Type[Model]
) -> List[Any]: ... ) -> List[Any]: ...
def _check_relation( def _check_relation(
self, self, obj: GenericTabularInline, parent_model: Type[Model]
obj: GenericTabularInline,
parent_model: Type[Model]
) -> List[Any]: ... ) -> List[Any]: ...

View File

@@ -5,5 +5,6 @@
from typing import Any, Optional from typing import Any, Optional
from typing import Any, List from typing import Any, List
def check_generic_foreign_keys(app_configs: None = ..., **kwargs: Any) -> List[Any]: ... def check_generic_foreign_keys(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
def check_model_name_lengths(app_configs: None = ..., **kwargs: Any) -> List[Any]: ... def check_model_name_lengths(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...

View File

@@ -1,36 +1,20 @@
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.core.checks.messages import Error from django.core.checks.messages import Error
from django.db.models.base import Model from django.db.models.base import Model
from django.db.models.fields import ( from django.db.models.fields import AutoField, PositiveIntegerField
AutoField,
PositiveIntegerField,
)
from django.db.models.fields.related import OneToOneField from django.db.models.fields.related import OneToOneField
from django.db.models.query import QuerySet from django.db.models.query import QuerySet
from django.db.models.query_utils import ( from django.db.models.query_utils import FilteredRelation, PathInfo
FilteredRelation,
PathInfo,
)
from django.db.models.sql.where import WhereNode from django.db.models.sql.where import WhereNode
from typing import ( from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
Any,
Callable,
Dict,
List,
Optional,
Tuple,
Type,
Union,
)
class GenericForeignKey: class GenericForeignKey:
def __get__( def __get__(
self, self, instance: Optional[Model], cls: Type[Model] = ...
instance: Optional[Model],
cls: Type[Model] = ...
) -> Optional[Union[Model, GenericForeignKey]]: ... ) -> Optional[Union[Model, GenericForeignKey]]: ...
def __init__(self, ct_field: str = ..., fk_field: str = ..., for_concrete_model: bool = ...) -> None: ... def __init__(
self, ct_field: str = ..., fk_field: str = ..., for_concrete_model: bool = ...
) -> None: ...
def __set__(self, instance: Model, value: Optional[Model]) -> None: ... def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
def __str__(self) -> str: ... def __str__(self) -> str: ...
def _check_content_type_field(self) -> List[Error]: ... def _check_content_type_field(self) -> List[Error]: ...
@@ -43,20 +27,16 @@ class GenericForeignKey:
self, self,
obj: Optional[Model] = ..., obj: Optional[Model] = ...,
id: Optional[int] = ..., id: Optional[int] = ...,
using: Optional[str] = ... using: Optional[str] = ...,
) -> ContentType: ... ) -> ContentType: ...
def get_filter_kwargs_for_object( def get_filter_kwargs_for_object(
self, self, obj: Model
obj: Model
) -> Dict[str, Optional[Union[ContentType, int]]]: ... ) -> Dict[str, Optional[Union[ContentType, int]]]: ...
def get_forward_related_filter(self, obj: Model) -> Dict[str, int]: ... def get_forward_related_filter(self, obj: Model) -> Dict[str, int]: ...
def get_prefetch_queryset( def get_prefetch_queryset(
self, self, instances: Union[List[Model], QuerySet], queryset: Optional[QuerySet] = ...
instances: Union[List[Model], QuerySet],
queryset: Optional[QuerySet] = ...
) -> Tuple[List[Model], Callable, Callable, bool, str, bool]: ... ) -> Tuple[List[Model], Callable, Callable, bool, str, bool]: ...
class GenericRel: class GenericRel:
def __init__( def __init__(
self, self,
@@ -64,10 +44,9 @@ class GenericRel:
to: Union[Type[Model], str], to: Union[Type[Model], str],
related_name: None = ..., related_name: None = ...,
related_query_name: Optional[str] = ..., related_query_name: Optional[str] = ...,
limit_choices_to: None = ... limit_choices_to: None = ...,
) -> None: ... ) -> None: ...
class GenericRelation: class GenericRelation:
def __init__( def __init__(
self, self,
@@ -77,35 +56,29 @@ class GenericRelation:
for_concrete_model: bool = ..., for_concrete_model: bool = ...,
related_query_name: Optional[str] = ..., related_query_name: Optional[str] = ...,
limit_choices_to: None = ..., limit_choices_to: None = ...,
**kwargs **kwargs,
) -> None: ... ) -> None: ...
def _check_generic_foreign_key_existence(self) -> List[Any]: ... def _check_generic_foreign_key_existence(self) -> List[Any]: ...
def _get_path_info_with_parent(self, filtered_relation: None) -> List[PathInfo]: ... def _get_path_info_with_parent(self, filtered_relation: None) -> List[PathInfo]: ...
def _is_matching_generic_foreign_key( def _is_matching_generic_foreign_key(
self, self, field: Optional[Union[GenericForeignKey, GenericRelation]]
field: Optional[Union[GenericForeignKey, GenericRelation]]
) -> bool: ... ) -> bool: ...
def bulk_related_objects( def bulk_related_objects(self, objs: List[Model], using: str = ...) -> QuerySet: ...
self,
objs: List[Model],
using: str = ...
) -> QuerySet: ...
def check(self, **kwargs) -> List[Error]: ... def check(self, **kwargs) -> List[Error]: ...
def contribute_to_class(self, cls: Type[Model], name: str, **kwargs) -> None: ... def contribute_to_class(self, cls: Type[Model], name: str, **kwargs) -> None: ...
def get_content_type(self) -> ContentType: ... def get_content_type(self) -> ContentType: ...
def get_extra_restriction( def get_extra_restriction(
self, self, where_class: Type[WhereNode], alias: Optional[str], remote_alias: str
where_class: Type[WhereNode],
alias: Optional[str],
remote_alias: str
) -> WhereNode: ... ) -> WhereNode: ...
def get_internal_type(self) -> str: ... def get_internal_type(self) -> str: ...
def get_path_info( def get_path_info(
self, self, filtered_relation: Optional[FilteredRelation] = ...
filtered_relation: Optional[FilteredRelation] = ...
) -> List[PathInfo]: ... ) -> List[PathInfo]: ...
def get_reverse_path_info(self, filtered_relation: None = ...) -> List[PathInfo]: ... def get_reverse_path_info(self, filtered_relation: None = ...) -> List[PathInfo]: ...
def resolve_related_fields( def resolve_related_fields(
self self
) -> Union[List[Tuple[PositiveIntegerField, related.OneToOneField]], List[Tuple[PositiveIntegerField, AutoField]]]: ... ) -> Union[
List[Tuple[PositiveIntegerField, related.OneToOneField]],
List[Tuple[PositiveIntegerField, AutoField]],
]: ...
def set_attributes_from_rel(self) -> None: ... def set_attributes_from_rel(self) -> None: ...

View File

@@ -12,15 +12,40 @@ from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
from django.db.migrations.migration import Migration from django.db.migrations.migration import Migration
from django.db.migrations.state import StateApps from django.db.migrations.state import StateApps
from typing import Any, List, Tuple, Type, Union from typing import Any, List, Tuple, Type, Union
class RenameContentType(migrations.RunPython): class RenameContentType(migrations.RunPython):
app_label: Any = ... app_label: Any = ...
old_model: Any = ... old_model: Any = ...
new_model: Any = ... new_model: Any = ...
def __init__(self, app_label: str, old_model: str, new_model: str) -> None: ... def __init__(self, app_label: str, old_model: str, new_model: str) -> None: ...
def _rename(self, apps: StateApps, schema_editor: DatabaseSchemaEditor, old_model: str, new_model: str) -> None: ... def _rename(
def rename_forward(self, apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: ... self,
def rename_backward(self, apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: ... apps: StateApps,
schema_editor: DatabaseSchemaEditor,
old_model: str,
new_model: str,
) -> None: ...
def rename_forward(
self, apps: StateApps, schema_editor: DatabaseSchemaEditor
) -> None: ...
def rename_backward(
self, apps: StateApps, schema_editor: DatabaseSchemaEditor
) -> None: ...
def inject_rename_contenttypes_operations(plan: Union[List[Any], List[Tuple[Migration, bool]]] = ..., apps: StateApps = ..., using: str = ..., **kwargs: Any) -> None: ... def inject_rename_contenttypes_operations(
def get_contenttypes_and_models(app_config: AppConfig, using: str, ContentType: Type[ContentType]) -> Any: ... plan: Union[List[Any], List[Tuple[Migration, bool]]] = ...,
def create_contenttypes(app_config: AppConfig, verbosity: int = ..., interactive: bool = ..., using: str = ..., apps: Apps = ..., **kwargs: Any) -> None: ... apps: StateApps = ...,
using: str = ...,
**kwargs: Any,
) -> None: ...
def get_contenttypes_and_models(
app_config: AppConfig, using: str, ContentType: Type[ContentType]
) -> Any: ...
def create_contenttypes(
app_config: AppConfig,
verbosity: int = ...,
interactive: bool = ...,
using: str = ...,
apps: Apps = ...,
**kwargs: Any,
) -> None: ...

View File

@@ -1,10 +1,8 @@
from django.core.management.base import CommandParser from django.core.management.base import CommandParser
class Command: class Command:
def add_arguments(self, parser: CommandParser) -> None: ... def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, **options) -> None: ... def handle(self, **options) -> None: ...
class NoFastDeleteCollector: class NoFastDeleteCollector:
def can_fast_delete(self, *args, **kwargs) -> bool: ... def can_fast_delete(self, *args, **kwargs) -> bool: ...

View File

@@ -1,13 +1,7 @@
from django.db.models.base import Model from django.db.models.base import Model
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 typing import ( from typing import Any, Dict, Tuple, Type
Any,
Dict,
Tuple,
Type,
)
class ContentType: class ContentType:
def __str__(self) -> str: ... def __str__(self) -> str: ...
@@ -18,7 +12,6 @@ class ContentType:
def name(self) -> str: ... def name(self) -> str: ...
def natural_key(self) -> Tuple[str, str]: ... def natural_key(self) -> Tuple[str, str]: ...
class ContentTypeManager: class ContentTypeManager:
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
def _add_to_cache(self, using: str, ct: ContentType) -> None: ... def _add_to_cache(self, using: str, ct: ContentType) -> None: ...
@@ -27,13 +20,7 @@ class ContentTypeManager:
def clear_cache(self) -> None: ... def clear_cache(self) -> None: ...
def get_by_natural_key(self, app_label: str, model: str) -> ContentType: ... def get_by_natural_key(self, app_label: str, model: str) -> ContentType: ...
def get_for_id(self, id: int) -> ContentType: ... def get_for_id(self, id: int) -> ContentType: ...
def get_for_model( def get_for_model(self, model: Any, for_concrete_model: bool = ...) -> ContentType: ...
self,
model: Any,
for_concrete_model: bool = ...
) -> ContentType: ...
def get_for_models( def get_for_models(
self, self, *models, for_concrete_models=...
*models,
for_concrete_models = ...
) -> Dict[Type[Model], ContentType]: ... ) -> Dict[Type[Model], ContentType]: ...

View File

@@ -2,9 +2,6 @@ from django.http.request import HttpRequest
from django.http.response import HttpResponseRedirect from django.http.response import HttpResponseRedirect
from typing import Union from typing import Union
def shortcut( def shortcut(
request: HttpRequest, request: HttpRequest, content_type_id: Union[str, int], object_id: Union[str, int]
content_type_id: Union[str, int],
object_id: Union[str, int]
) -> HttpResponseRedirect: ... ) -> HttpResponseRedirect: ...

View File

@@ -5,5 +5,6 @@
from django.contrib.sitemaps import Sitemap from django.contrib.sitemaps import Sitemap
from django.db.models.query import QuerySet from django.db.models.query import QuerySet
class FlatPageSitemap(Sitemap): class FlatPageSitemap(Sitemap):
def items(self) -> QuerySet: ... def items(self) -> QuerySet: ...

View File

@@ -6,6 +6,7 @@ from typing import Any, Optional
from datetime import date, datetime from datetime import date, datetime
from typing import Optional, Union from typing import Optional, Union
register: Any register: Any
def ordinal(value: Optional[str]) -> Optional[str]: ... def ordinal(value: Optional[str]) -> Optional[str]: ...

View File

@@ -8,14 +8,46 @@ from django.contrib.messages.storage.base import BaseStorage
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
from django.http.request import HttpRequest from django.http.request import HttpRequest
from typing import Optional, Union from typing import Optional, Union
class MessageFailure(Exception): ... class MessageFailure(Exception): ...
def add_message(request: Optional[WSGIRequest], level: int, message: str, extra_tags: str = ..., fail_silently: Union[str, bool] = ...) -> None: ... def add_message(
request: Optional[WSGIRequest],
level: int,
message: str,
extra_tags: str = ...,
fail_silently: Union[str, bool] = ...,
) -> None: ...
def get_messages(request: HttpRequest) -> BaseStorage: ... def get_messages(request: HttpRequest) -> BaseStorage: ...
def get_level(request: HttpRequest) -> int: ... def get_level(request: HttpRequest) -> int: ...
def set_level(request: HttpRequest, level: int) -> bool: ... def set_level(request: HttpRequest, level: int) -> bool: ...
def debug(request: WSGIRequest, message: str, extra_tags: str = ..., fail_silently: Union[str, bool] = ...) -> None: ... def debug(
def info(request: WSGIRequest, message: str, extra_tags: str = ..., fail_silently: Union[str, bool] = ...) -> None: ... request: WSGIRequest,
def success(request: WSGIRequest, message: str, extra_tags: str = ..., fail_silently: Union[str, bool] = ...) -> None: ... message: str,
def warning(request: WSGIRequest, message: str, extra_tags: str = ..., fail_silently: Union[str, bool] = ...) -> None: ... extra_tags: str = ...,
def error(request: WSGIRequest, message: str, extra_tags: str = ..., fail_silently: Union[str, bool] = ...) -> None: ... fail_silently: Union[str, bool] = ...,
) -> None: ...
def info(
request: WSGIRequest,
message: str,
extra_tags: str = ...,
fail_silently: Union[str, bool] = ...,
) -> None: ...
def success(
request: WSGIRequest,
message: str,
extra_tags: str = ...,
fail_silently: Union[str, bool] = ...,
) -> None: ...
def warning(
request: WSGIRequest,
message: str,
extra_tags: str = ...,
fail_silently: Union[str, bool] = ...,
) -> None: ...
def error(
request: WSGIRequest,
message: str,
extra_tags: str = ...,
fail_silently: Union[str, bool] = ...,
) -> None: ...

View File

@@ -7,4 +7,5 @@ from typing import Any
from django.contrib.messages.storage.base import BaseStorage from django.contrib.messages.storage.base import BaseStorage
from django.http.request import HttpRequest from django.http.request import HttpRequest
from typing import Dict, Union from typing import Dict, Union
def messages(request: HttpRequest) -> Dict[str, Union[Dict[str, int], BaseStorage]]: ... def messages(request: HttpRequest) -> Dict[str, Union[Dict[str, int], BaseStorage]]: ...

View File

@@ -8,6 +8,9 @@ from typing import Any
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
from django.http.request import HttpRequest from django.http.request import HttpRequest
from django.http.response import HttpResponseBase from django.http.response import HttpResponseBase
class MessageMiddleware(MiddlewareMixin): class MessageMiddleware(MiddlewareMixin):
def process_request(self, request: WSGIRequest) -> None: ... def process_request(self, request: WSGIRequest) -> None: ...
def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ... def process_response(
self, request: HttpRequest, response: HttpResponseBase
) -> HttpResponseBase: ...

View File

@@ -6,4 +6,5 @@ from typing import Any
from django.contrib.messages.storage.base import BaseStorage from django.contrib.messages.storage.base import BaseStorage
from django.http.request import HttpRequest from django.http.request import HttpRequest
def default_storage(request: HttpRequest) -> BaseStorage: ... def default_storage(request: HttpRequest) -> BaseStorage: ...

View File

@@ -1,11 +1,6 @@
from django.http.request import HttpRequest from django.http.request import HttpRequest
from django.http.response import HttpResponseBase from django.http.response import HttpResponseBase
from typing import ( from typing import List, Optional, Union
List,
Optional,
Union,
)
class BaseStorage: class BaseStorage:
def __init__(self, request: HttpRequest, *args, **kwargs) -> None: ... def __init__(self, request: HttpRequest, *args, **kwargs) -> None: ...
@@ -18,10 +13,11 @@ class BaseStorage:
def add(self, level: int, message: str, extra_tags: Optional[str] = ...) -> None: ... def add(self, level: int, message: str, extra_tags: Optional[str] = ...) -> None: ...
def update(self, response: HttpResponseBase) -> None: ... def update(self, response: HttpResponseBase) -> None: ...
class Message: class Message:
def __eq__(self, other: Union[str, Message]) -> bool: ... def __eq__(self, other: Union[str, Message]) -> bool: ...
def __init__(self, level: int, message: str, extra_tags: Optional[str] = ...) -> None: ... def __init__(
self, level: int, message: str, extra_tags: Optional[str] = ...
) -> None: ...
def __str__(self) -> str: ... def __str__(self) -> str: ...
def _prepare(self) -> None: ... def _prepare(self) -> None: ...
@property @property

View File

@@ -9,22 +9,43 @@ from typing import Any
from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.base import Message
from django.http.response import HttpResponse from django.http.response import HttpResponse
from typing import Any, List, Optional, Tuple, Union from typing import Any, List, Optional, Tuple, Union
class MessageEncoder(json.JSONEncoder): class MessageEncoder(json.JSONEncoder):
message_key: str = ... message_key: str = ...
def default(self, obj: Message) -> List[Union[int, str]]: ... def default(self, obj: Message) -> List[Union[int, str]]: ...
class MessageDecoder(json.JSONDecoder): class MessageDecoder(json.JSONDecoder):
def process_messages(self, obj: Any) -> Any: ... def process_messages(self, obj: Any) -> Any: ...
def decode(self, s: str, **kwargs: Any) -> Union[List[Union[Message, str]], List[Message], List[str]]: ... def decode(
self, s: str, **kwargs: Any
) -> Union[List[Union[Message, str]], List[Message], List[str]]: ...
class CookieStorage(BaseStorage): class CookieStorage(BaseStorage):
cookie_name: str = ... cookie_name: str = ...
max_cookie_size: int = ... max_cookie_size: int = ...
not_finished: str = ... not_finished: str = ...
def _get(self, *args: Any, **kwargs: Any) -> Union[Tuple[None, bool], Tuple[List[Any], bool], Tuple[List[str], bool], Tuple[List[Message], bool]]: ... def _get(
def _update_cookie(self, encoded_data: Optional[str], response: HttpResponse) -> None: ... self, *args: Any, **kwargs: Any
def _store(self, messages: List[Message], response: HttpResponse, remove_oldest: bool = ..., *args: Any, **kwargs: Any) -> List[Message]: ... ) -> Union[
Tuple[None, bool],
Tuple[List[Any], bool],
Tuple[List[str], bool],
Tuple[List[Message], bool],
]: ...
def _update_cookie(
self, encoded_data: Optional[str], response: HttpResponse
) -> None: ...
def _store(
self,
messages: List[Message],
response: HttpResponse,
remove_oldest: bool = ...,
*args: Any,
**kwargs: Any,
) -> List[Message]: ...
def _hash(self, value: str) -> str: ... def _hash(self, value: str) -> str: ...
def _encode(self, messages: Union[List[Message], List[str]], encode_empty: bool = ...) -> Optional[str]: ... def _encode(
self, messages: Union[List[Message], List[str]], encode_empty: bool = ...
) -> Optional[str]: ...
used: bool = ... used: bool = ...
def _decode(self, data: Optional[str]) -> Any: ... def _decode(self, data: Optional[str]) -> Any: ...

View File

@@ -8,10 +8,17 @@ from typing import Any
from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.base import Message
from django.http.response import HttpResponse from django.http.response import HttpResponse
from typing import Any, List, Tuple, Union from typing import Any, List, Tuple, Union
class FallbackStorage(BaseStorage): class FallbackStorage(BaseStorage):
storage_classes: Any = ... storage_classes: Any = ...
storages: Any = ... storages: Any = ...
_used_storages: Any = ... _used_storages: Any = ...
def __init__(self, *args: Any, **kwargs: Any) -> None: ... def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def _get(self, *args: Any, **kwargs: Any) -> Union[Tuple[List[Any], bool], Tuple[List[str], bool], Tuple[List[Message], bool]]: ... def _get(
def _store(self, messages: List[Message], response: HttpResponse, *args: Any, **kwargs: Any) -> List[Any]: ... self, *args: Any, **kwargs: Any
) -> Union[
Tuple[List[Any], bool], Tuple[List[str], bool], Tuple[List[Message], bool]
]: ...
def _store(
self, messages: List[Message], response: HttpResponse, *args: Any, **kwargs: Any
) -> List[Any]: ...

View File

@@ -9,10 +9,17 @@ from django.contrib.messages.storage.base import Message
from django.http.request import HttpRequest from django.http.request import HttpRequest
from django.http.response import HttpResponse from django.http.response import HttpResponse
from typing import Any, List, Optional, Tuple, Union from typing import Any, List, Optional, Tuple, Union
class SessionStorage(BaseStorage): class SessionStorage(BaseStorage):
session_key: str = ... session_key: str = ...
def __init__(self, request: HttpRequest, *args: Any, **kwargs: Any) -> None: ... def __init__(self, request: HttpRequest, *args: Any, **kwargs: Any) -> None: ...
def _get(self, *args: Any, **kwargs: Any) -> Union[Tuple[None, bool], Tuple[List[str], bool], Tuple[List[Message], bool]]: ... def _get(
def _store(self, messages: List[Message], response: HttpResponse, *args: Any, **kwargs: Any) -> List[Any]: ... self, *args: Any, **kwargs: Any
) -> Union[Tuple[None, bool], Tuple[List[str], bool], Tuple[List[Message], bool]]: ...
def _store(
self, messages: List[Message], response: HttpResponse, *args: Any, **kwargs: Any
) -> List[Any]: ...
def serialize_messages(self, messages: Union[List[Message], List[str]]) -> str: ... def serialize_messages(self, messages: Union[List[Message], List[str]]) -> str: ...
def deserialize_messages(self, data: Optional[str]) -> Optional[Union[List[Message], List[str]]]: ... def deserialize_messages(
self, data: Optional[str]
) -> Optional[Union[List[Message], List[str]]]: ...

View File

@@ -3,4 +3,5 @@
# NOTE: This dynamically typed stub was automatically generated by stubgen. # NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Dict from typing import Dict
def get_level_tags() -> Dict[int, str]: ... def get_level_tags() -> Dict[int, str]: ...

View File

@@ -7,6 +7,7 @@ from typing import Any, Optional
from datetime import datetime, timedelta from datetime import datetime, timedelta
from django.db.models.base import Model from django.db.models.base import Model
from typing import Dict, Optional, Union from typing import Dict, Optional, Union
VALID_KEY_CHARS: Any VALID_KEY_CHARS: Any
class CreateError(Exception): ... class CreateError(Exception): ...
@@ -25,7 +26,9 @@ class SessionBase:
def __getitem__(self, key: str) -> Union[str, Model, int]: ... def __getitem__(self, key: str) -> Union[str, Model, int]: ...
def __setitem__(self, key: str, value: Union[str, datetime, int]) -> None: ... def __setitem__(self, key: str, value: Union[str, datetime, int]) -> None: ...
def __delitem__(self, key: str) -> None: ... def __delitem__(self, key: str) -> None: ...
def get(self, key: str, default: Optional[str] = ...) -> Optional[Union[str, datetime, int]]: ... def get(
self, key: str, default: Optional[str] = ...
) -> Optional[Union[str, datetime, int]]: ...
def pop(self, key: str, default: object = ...) -> Union[str, int]: ... def pop(self, key: str, default: object = ...) -> Union[str, int]: ...
def setdefault(self, key: str, value: str) -> str: ... def setdefault(self, key: str, value: str) -> str: ...
def set_test_cookie(self) -> None: ... def set_test_cookie(self) -> None: ...
@@ -49,7 +52,9 @@ class SessionBase:
__session_key: Any = ... __session_key: Any = ...
def _set_session_key(self, value: Optional[str]) -> None: ... def _set_session_key(self, value: Optional[str]) -> None: ...
session_key: Any = ... session_key: Any = ...
def _get_session(self, no_load: bool = ...) -> Dict[str, Union[str, int, datetime, Model]]: ... def _get_session(
self, no_load: bool = ...
) -> Dict[str, Union[str, int, datetime, Model]]: ...
_session: Any = ... _session: Any = ...
def get_expiry_age(self, **kwargs: Any) -> int: ... def get_expiry_age(self, **kwargs: Any) -> int: ...
def get_expiry_date(self, **kwargs: Any) -> datetime: ... def get_expiry_date(self, **kwargs: Any) -> datetime: ...

View File

@@ -6,6 +6,7 @@ from django.contrib.sessions.backends.base import SessionBase
from typing import Any, Optional from typing import Any, Optional
from typing import Any, Dict, Optional from typing import Any, Dict, Optional
KEY_PREFIX: str KEY_PREFIX: str
class SessionStore(SessionBase): class SessionStore(SessionBase):

View File

@@ -6,6 +6,7 @@ from django.contrib.sessions.backends.db import SessionStore as DBStore
from typing import Any, Optional from typing import Any, Optional
from typing import Any, Dict, Optional from typing import Any, Dict, Optional
KEY_PREFIX: str KEY_PREFIX: str
class SessionStore(DBStore): class SessionStore(DBStore):

View File

@@ -9,6 +9,7 @@ from datetime import datetime
from django.contrib.sessions.base_session import AbstractBaseSession from django.contrib.sessions.base_session import AbstractBaseSession
from django.contrib.sessions.models import Session from django.contrib.sessions.models import Session
from typing import Dict, Optional, Type, Union from typing import Dict, Optional, Type, Union
class SessionStore(SessionBase): class SessionStore(SessionBase):
def __init__(self, session_key: Optional[str] = ...) -> None: ... def __init__(self, session_key: Optional[str] = ...) -> None: ...
@classmethod @classmethod
@@ -20,7 +21,9 @@ class SessionStore(SessionBase):
def exists(self, session_key: Optional[str]) -> bool: ... def exists(self, session_key: Optional[str]) -> bool: ...
modified: bool = ... modified: bool = ...
def create(self) -> None: ... def create(self) -> None: ...
def create_model_instance(self, data: Dict[str, Union[str, int, datetime]]) -> AbstractBaseSession: ... def create_model_instance(
self, data: Dict[str, Union[str, int, datetime]]
) -> AbstractBaseSession: ...
def save(self, must_create: bool = ...) -> None: ... def save(self, must_create: bool = ...) -> None: ...
def delete(self, session_key: Optional[str] = ...) -> None: ... def delete(self, session_key: Optional[str] = ...) -> None: ...
@classmethod @classmethod

View File

@@ -6,6 +6,7 @@ from django.contrib.sessions.backends.base import SessionBase
from typing import Any, Optional from typing import Any, Optional
from typing import Dict, Optional from typing import Dict, Optional
class SessionStore(SessionBase): class SessionStore(SessionBase):
storage_path: Any = ... storage_path: Any = ...
file_prefix: Any = ... file_prefix: Any = ...

View File

@@ -7,6 +7,7 @@ from typing import Any, Optional
from datetime import datetime from datetime import datetime
from typing import Dict, Optional, Union from typing import Dict, Optional, Union
class SessionStore(SessionBase): class SessionStore(SessionBase):
def load(self) -> Dict[str, Union[str, datetime]]: ... def load(self) -> Dict[str, Union[str, datetime]]: ...
modified: bool = ... modified: bool = ...

View File

@@ -1,6 +1,5 @@
from typing import Dict from typing import Dict
class AbstractBaseSession: class AbstractBaseSession:
def __str__(self) -> str: ... def __str__(self) -> str: ...
def get_decoded(self) -> Dict[str, int]: ... def get_decoded(self) -> Dict[str, int]: ...

View File

@@ -8,9 +8,12 @@ from typing import Any, Optional
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
from django.http.response import HttpResponseBase from django.http.response import HttpResponseBase
from typing import Callable, Optional from typing import Callable, Optional
class SessionMiddleware(MiddlewareMixin): class SessionMiddleware(MiddlewareMixin):
get_response: Any = ... get_response: Any = ...
SessionStore: Any = ... SessionStore: Any = ...
def __init__(self, get_response: Optional[Callable] = ...) -> None: ... def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
def process_request(self, request: WSGIRequest) -> None: ... def process_request(self, request: WSGIRequest) -> None: ...
def process_response(self, request: WSGIRequest, response: HttpResponseBase) -> HttpResponseBase: ... def process_response(
self, request: WSGIRequest, response: HttpResponseBase
) -> HttpResponseBase: ...

View File

@@ -1,7 +1,6 @@
from django.contrib.sessions.backends.db import SessionStore from django.contrib.sessions.backends.db import SessionStore
from typing import Type from typing import Type
class Session: class Session:
@classmethod @classmethod
def get_session_store_class(cls) -> Type[SessionStore]: ... def get_session_store_class(cls) -> Type[SessionStore]: ...

View File

@@ -8,7 +8,9 @@ from typing import Any
from datetime import datetime from datetime import datetime
from django.db.models.base import Model from django.db.models.base import Model
from typing import Dict, Union from typing import Dict, Union
class PickleSerializer: class PickleSerializer:
def dumps(self, obj: Dict[str, Union[str, datetime]]) -> bytes: ... def dumps(self, obj: Dict[str, Union[str, datetime]]) -> bytes: ...
def loads(self, data: bytes) -> Dict[str, Model]: ... def loads(self, data: bytes) -> Dict[str, Model]: ...
JSONSerializer = BaseJSONSerializer JSONSerializer = BaseJSONSerializer

View File

@@ -11,6 +11,7 @@ from django.core.paginator import Paginator
from django.db.models.base import Model from django.db.models.base import Model
from django.db.models.query import QuerySet from django.db.models.query import QuerySet
from typing import Any, Dict, List, Optional, Union from typing import Any, Dict, List, Optional, Union
PING_URL: str PING_URL: str
class SitemapNotFound(Exception): ... class SitemapNotFound(Exception): ...
@@ -26,9 +27,18 @@ class Sitemap:
def location(self, obj: Model) -> str: ... def location(self, obj: Model) -> str: ...
@property @property
def paginator(self) -> Paginator: ... def paginator(self) -> Paginator: ...
def get_urls(self, page: Union[str, int] = ..., site: Optional[Union[RequestSite, Site]] = ..., protocol: Optional[str] = ...) -> Union[List[Dict[str, object]], List[Dict[str, Union[Model, str, datetime, None]]]]: ... def get_urls(
self,
page: Union[str, int] = ...,
site: Optional[Union[RequestSite, Site]] = ...,
protocol: Optional[str] = ...,
) -> Union[
List[Dict[str, object]], List[Dict[str, Union[Model, str, datetime, None]]]
]: ...
latest_lastmod: Any = ... latest_lastmod: Any = ...
def _urls(self, page: Union[str, int], protocol: str, domain: str) -> Union[List[Dict[str, object]], List[Dict[str, Union[Model, str, None]]]]: ... def _urls(
self, page: Union[str, int], protocol: str, domain: str
) -> Union[List[Dict[str, object]], List[Dict[str, Union[Model, str, None]]]]: ...
class GenericSitemap(Sitemap): class GenericSitemap(Sitemap):
priority: Any = ... priority: Any = ...
@@ -36,7 +46,13 @@ class GenericSitemap(Sitemap):
queryset: Any = ... queryset: Any = ...
date_field: Any = ... date_field: Any = ...
protocol: Any = ... protocol: Any = ...
def __init__(self, info_dict: Dict[str, Union[QuerySet, datetime]], priority: Optional[float] = ..., changefreq: Optional[str] = ..., protocol: Optional[str] = ...) -> None: ... def __init__(
self,
info_dict: Dict[str, Union[QuerySet, datetime]],
priority: Optional[float] = ...,
changefreq: Optional[str] = ...,
protocol: Optional[str] = ...,
) -> None: ...
def items(self): ... def items(self): ...
def lastmod(self, item: Model) -> None: ... def lastmod(self, item: Model) -> None: ...

View File

@@ -9,6 +9,19 @@ from django.contrib.sitemaps import GenericSitemap, Sitemap
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from typing import Callable, Dict, Optional, Type, Union from typing import Callable, Dict, Optional, Type, Union
def x_robots_tag(func: Callable) -> Callable: ... def x_robots_tag(func: Callable) -> Callable: ...
def index(request: WSGIRequest, sitemaps: Dict[str, Type[Sitemap]], template_name: str = ..., content_type: str = ..., sitemap_url_name: str = ...) -> TemplateResponse: ... def index(
def sitemap(request: WSGIRequest, sitemaps: Dict[str, Union[Type[Sitemap], Type[FlatPageSitemap], GenericSitemap]], section: Optional[str] = ..., template_name: str = ..., content_type: str = ...) -> TemplateResponse: ... request: WSGIRequest,
sitemaps: Dict[str, Type[Sitemap]],
template_name: str = ...,
content_type: str = ...,
sitemap_url_name: str = ...,
) -> TemplateResponse: ...
def sitemap(
request: WSGIRequest,
sitemaps: Dict[str, Union[Type[Sitemap], Type[FlatPageSitemap], GenericSitemap]],
section: Optional[str] = ...,
template_name: str = ...,
content_type: str = ...,
) -> TemplateResponse: ...

View File

@@ -6,4 +6,12 @@ from typing import Any
from django.apps.registry import Apps from django.apps.registry import Apps
from django.contrib.sites.apps import SitesConfig from django.contrib.sites.apps import SitesConfig
def create_default_site(app_config: SitesConfig, verbosity: int = ..., interactive: bool = ..., using: str = ..., apps: Apps = ..., **kwargs: Any) -> None: ...
def create_default_site(
app_config: SitesConfig,
verbosity: int = ...,
interactive: bool = ...,
using: str = ...,
apps: Apps = ...,
**kwargs: Any,
) -> None: ...

View File

@@ -8,6 +8,7 @@ from typing import Any, Optional
from django.core.checks.messages import Error from django.core.checks.messages import Error
from django.db.models.query import QuerySet from django.db.models.query import QuerySet
from typing import List from typing import List
class CurrentSiteManager(models.Manager): class CurrentSiteManager(models.Manager):
use_in_migrations: bool = ... use_in_migrations: bool = ...
__field_name: Any = ... __field_name: Any = ...

View File

@@ -7,5 +7,6 @@ from django.utils.deprecation import MiddlewareMixin
from typing import Any from typing import Any
from django.http.request import HttpRequest from django.http.request import HttpRequest
class CurrentSiteMiddleware(MiddlewareMixin): class CurrentSiteMiddleware(MiddlewareMixin):
def process_request(self, request: HttpRequest) -> None: ... def process_request(self, request: HttpRequest) -> None: ...

View File

@@ -1,26 +1,15 @@
from django.http.request import HttpRequest from django.http.request import HttpRequest
from typing import ( from typing import Optional, Type
Optional,
Type,
)
def _simple_domain_name_validator(value: str): ... def _simple_domain_name_validator(value: str): ...
def clear_site_cache(sender: Type[Site], **kwargs) -> None: ... def clear_site_cache(sender: Type[Site], **kwargs) -> None: ...
class Site: class Site:
def __str__(self) -> str: ... def __str__(self) -> str: ...
class SiteManager: class SiteManager:
def _get_site_by_id(self, site_id: int) -> Site: ... def _get_site_by_id(self, site_id: int) -> Site: ...
def _get_site_by_request(self, request: HttpRequest) -> Site: ... def _get_site_by_request(self, request: HttpRequest) -> Site: ...
def clear_cache(self) -> None: ... def clear_cache(self) -> None: ...
def get_by_natural_key(self, domain: str) -> Site: ... def get_by_natural_key(self, domain: str) -> Site: ...
def get_current( def get_current(self, request: Optional[HttpRequest] = ...) -> Site: ...
self,
request: Optional[HttpRequest] = ...
) -> Site: ...

View File

@@ -5,6 +5,7 @@
from typing import Any from typing import Any
from django.http.request import HttpRequest from django.http.request import HttpRequest
class RequestSite: class RequestSite:
domain: Any = ... domain: Any = ...
def __init__(self, request: HttpRequest) -> None: ... def __init__(self, request: HttpRequest) -> None: ...

View File

@@ -8,4 +8,5 @@ from django.contrib.sites.models import Site
from django.contrib.sites.requests import RequestSite from django.contrib.sites.requests import RequestSite
from django.http.request import HttpRequest from django.http.request import HttpRequest
from typing import Optional, Union from typing import Optional, Union
def get_current_site(request: Optional[HttpRequest]) -> Union[RequestSite, Site]: ... def get_current_site(request: Optional[HttpRequest]) -> Union[RequestSite, Site]: ...

View File

@@ -5,4 +5,5 @@
from typing import Any, Optional from typing import Any, Optional
from typing import Any, List from typing import Any, List
def check_finders(app_configs: None = ..., **kwargs: Any) -> List[Any]: ... def check_finders(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...

View File

@@ -8,6 +8,7 @@ from django.contrib.staticfiles.storage import StaticFilesStorage
from django.core.checks.messages import Error from django.core.checks.messages import Error
from django.core.files.storage import DefaultStorage, FileSystemStorage from django.core.files.storage import DefaultStorage, FileSystemStorage
from typing import Iterator, List, Optional, Tuple, Union from typing import Iterator, List, Optional, Tuple, Union
searched_locations: Any searched_locations: Any
class BaseFinder: class BaseFinder:
@@ -22,7 +23,9 @@ class FileSystemFinder(BaseFinder):
def check(self, **kwargs: Any) -> List[Error]: ... def check(self, **kwargs: Any) -> List[Error]: ...
def find(self, path: str, all: bool = ...) -> Union[str, List[str]]: ... def find(self, path: str, all: bool = ...) -> Union[str, List[str]]: ...
def find_location(self, root: str, path: str, prefix: str = ...) -> Optional[str]: ... def find_location(self, root: str, path: str, prefix: str = ...) -> Optional[str]: ...
def list(self, ignore_patterns: List[str]) -> Iterator[Tuple[str, FileSystemStorage]]: ... def list(
self, ignore_patterns: List[str]
) -> Iterator[Tuple[str, FileSystemStorage]]: ...
class AppDirectoriesFinder(BaseFinder): class AppDirectoriesFinder(BaseFinder):
storage_class: Any = ... storage_class: Any = ...
@@ -30,13 +33,17 @@ class AppDirectoriesFinder(BaseFinder):
apps: Any = ... apps: Any = ...
storages: Any = ... storages: Any = ...
def __init__(self, app_names: None = ..., *args: Any, **kwargs: Any) -> None: ... def __init__(self, app_names: None = ..., *args: Any, **kwargs: Any) -> None: ...
def list(self, ignore_patterns: List[str]) -> Iterator[Tuple[str, FileSystemStorage]]: ... def list(
self, ignore_patterns: List[str]
) -> Iterator[Tuple[str, FileSystemStorage]]: ...
def find(self, path: str, all: bool = ...) -> str: ... def find(self, path: str, all: bool = ...) -> str: ...
def find_in_app(self, app: str, path: str) -> Optional[str]: ... def find_in_app(self, app: str, path: str) -> Optional[str]: ...
class BaseStorageFinder(BaseFinder): class BaseStorageFinder(BaseFinder):
storage: Any = ... storage: Any = ...
def __init__(self, storage: Optional[StaticFilesStorage] = ..., *args: Any, **kwargs: Any) -> None: ... def __init__(
self, storage: Optional[StaticFilesStorage] = ..., *args: Any, **kwargs: Any
) -> None: ...
def find(self, path: Any, all: bool = ...): ... def find(self, path: Any, all: bool = ...): ...
def list(self, ignore_patterns: List[str]) -> Iterator[Tuple[str, DefaultStorage]]: ... def list(self, ignore_patterns: List[str]) -> Iterator[Tuple[str, DefaultStorage]]: ...

View File

@@ -6,6 +6,7 @@ from django.core.handlers.wsgi import WSGIHandler
from typing import Any from typing import Any
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
class StaticFilesHandler(WSGIHandler): class StaticFilesHandler(WSGIHandler):
handles_files: bool = ... handles_files: bool = ...
application: Any = ... application: Any = ...

View File

@@ -1,15 +1,6 @@
from django.core.files.storage import ( from django.core.files.storage import DefaultStorage, FileSystemStorage
DefaultStorage,
FileSystemStorage,
)
from django.core.management.base import CommandParser from django.core.management.base import CommandParser
from typing import ( from typing import Dict, List, Optional, Union
Dict,
List,
Optional,
Union,
)
class Command: class Command:
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
@@ -20,13 +11,13 @@ class Command:
self, self,
path: str, path: str,
prefixed_path: str, prefixed_path: str,
source_storage: Union[FileSystemStorage, DefaultStorage] source_storage: Union[FileSystemStorage, DefaultStorage],
) -> None: ... ) -> None: ...
def delete_file( def delete_file(
self, self,
path: str, path: str,
prefixed_path: str, prefixed_path: str,
source_storage: Union[FileSystemStorage, DefaultStorage] source_storage: Union[FileSystemStorage, DefaultStorage],
) -> bool: ... ) -> bool: ...
def handle(self, **options) -> Optional[str]: ... def handle(self, **options) -> Optional[str]: ...
def is_local_storage(self) -> bool: ... def is_local_storage(self) -> bool: ...
@@ -34,7 +25,7 @@ class Command:
self, self,
path: str, path: str,
prefixed_path: str, prefixed_path: str,
source_storage: Union[FileSystemStorage, DefaultStorage] source_storage: Union[FileSystemStorage, DefaultStorage],
) -> None: ... ) -> None: ...
@cached_property @cached_property
def local(self) -> bool: ... def local(self) -> bool: ...

View File

@@ -1,6 +1,5 @@
from django.core.management.base import CommandParser from django.core.management.base import CommandParser
class Command: class Command:
def add_arguments(self, parser: CommandParser) -> None: ... def add_arguments(self, parser: CommandParser) -> None: ...
def handle_label(self, path: str, **options) -> str: ... def handle_label(self, path: str, **options) -> str: ...

View File

@@ -1,5 +1,4 @@
from django.contrib.staticfiles.handlers import StaticFilesHandler from django.contrib.staticfiles.handlers import StaticFilesHandler
class Command: class Command:
def get_handler(self, *args, **options) -> StaticFilesHandler: ... def get_handler(self, *args, **options) -> StaticFilesHandler: ...

View File

@@ -11,10 +11,13 @@ from django.core.cache import DefaultCacheProxy
from django.core.files.base import File from django.core.files.base import File
from django.utils.safestring import SafeText from django.utils.safestring import SafeText
from typing import Callable, Dict, Iterator, List, Optional, Tuple, Union from typing import Callable, Dict, Iterator, List, Optional, Tuple, Union
class StaticFilesStorage(FileSystemStorage): class StaticFilesStorage(FileSystemStorage):
base_location: Any = ... base_location: Any = ...
location: Any = ... location: Any = ...
def __init__(self, location: Optional[str] = ..., base_url: None = ..., *args: Any, **kwargs: Any) -> None: ... def __init__(
self, location: Optional[str] = ..., base_url: None = ..., *args: Any, **kwargs: Any
) -> None: ...
def path(self, name: str) -> str: ... def path(self, name: str) -> str: ...
class HashedFilesMixin: class HashedFilesMixin:
@@ -25,12 +28,29 @@ class HashedFilesMixin:
hashed_files: Any = ... hashed_files: Any = ...
def __init__(self, *args: Any, **kwargs: Any) -> None: ... def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def file_hash(self, name: str, content: File = ...) -> str: ... def file_hash(self, name: str, content: File = ...) -> str: ...
def hashed_name(self, name: str, content: Optional[File] = ..., filename: Optional[str] = ...) -> str: ... def hashed_name(
def _url(self, hashed_name_func: Callable, name: str, force: bool = ..., hashed_files: Optional[OrderedDict] = ...) -> str: ... self, name: str, content: Optional[File] = ..., filename: Optional[str] = ...
) -> str: ...
def _url(
self,
hashed_name_func: Callable,
name: str,
force: bool = ...,
hashed_files: Optional[OrderedDict] = ...,
) -> str: ...
def url(self, name: SafeText, force: bool = ...) -> str: ... def url(self, name: SafeText, force: bool = ...) -> str: ...
def url_converter(self, name: str, hashed_files: OrderedDict, template: str = ...) -> Callable: ... def url_converter(
def post_process(self, paths: OrderedDict, dry_run: bool = ..., **options: Any) -> Iterator[Tuple[str, str, bool]]: ... self, name: str, hashed_files: OrderedDict, template: str = ...
def _post_process(self, paths: Union[OrderedDict, Dict[str, Tuple[FileSystemStorage, str]]], adjustable_paths: List[str], hashed_files: OrderedDict) -> Iterator[Tuple[str, str, bool, bool]]: ... ) -> Callable: ...
def post_process(
self, paths: OrderedDict, dry_run: bool = ..., **options: Any
) -> Iterator[Tuple[str, str, bool]]: ...
def _post_process(
self,
paths: Union[OrderedDict, Dict[str, Tuple[FileSystemStorage, str]]],
adjustable_paths: List[str],
hashed_files: OrderedDict,
) -> Iterator[Tuple[str, str, bool, bool]]: ...
def clean_name(self, name: str) -> str: ... def clean_name(self, name: str) -> str: ...
def hash_key(self, name: str) -> str: ... def hash_key(self, name: str) -> str: ...
def _stored_name(self, name: str, hashed_files: OrderedDict) -> str: ... def _stored_name(self, name: str, hashed_files: OrderedDict) -> str: ...

View File

@@ -6,6 +6,7 @@ from typing import Any
from django.template.base import Parser, Token from django.template.base import Parser, Token
from django.templatetags.static import StaticNode from django.templatetags.static import StaticNode
register: Any register: Any
def static(path: Any): ... def static(path: Any): ...

View File

@@ -6,6 +6,7 @@ from typing import Any, Optional
from django.urls.resolvers import URLPattern from django.urls.resolvers import URLPattern
from typing import List from typing import List
urlpatterns: Any urlpatterns: Any
def staticfiles_urlpatterns(prefix: None = ...) -> List[URLPattern]: ... def staticfiles_urlpatterns(prefix: None = ...) -> List[URLPattern]: ...

View File

@@ -7,6 +7,13 @@ from typing import Any, Optional
from collections import OrderedDict from collections import OrderedDict
from django.core.files.storage import DefaultStorage, FileSystemStorage from django.core.files.storage import DefaultStorage, FileSystemStorage
from typing import Iterator, List, Tuple, Union from typing import Iterator, List, Tuple, Union
def matches_patterns(path: str, patterns: Union[OrderedDict, List[str], Tuple[str]] = ...) -> bool: ...
def get_files(storage: Union[FileSystemStorage, DefaultStorage], ignore_patterns: List[str] = ..., location: str = ...) -> Iterator[str]: ... def matches_patterns(
path: str, patterns: Union[OrderedDict, List[str], Tuple[str]] = ...
) -> bool: ...
def get_files(
storage: Union[FileSystemStorage, DefaultStorage],
ignore_patterns: List[str] = ...,
location: str = ...,
) -> Iterator[str]: ...
def check_settings(base_url: str = ...) -> None: ... def check_settings(base_url: str = ...) -> None: ...

View File

@@ -6,4 +6,7 @@ from typing import Any
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
from django.http.response import FileResponse from django.http.response import FileResponse
def serve(request: WSGIRequest, path: str, insecure: bool = ..., **kwargs: Any) -> FileResponse: ...
def serve(
request: WSGIRequest, path: str, insecure: bool = ..., **kwargs: Any
) -> FileResponse: ...

View File

@@ -11,6 +11,7 @@ from django.http.response import HttpResponse
from django.utils.feedgenerator import Atom1Feed, Enclosure, Rss201rev2Feed from django.utils.feedgenerator import Atom1Feed, Enclosure, Rss201rev2Feed
from django.utils.safestring import SafeText from django.utils.safestring import SafeText
from typing import Any, Dict, List, Optional, Union from typing import Any, Dict, List, Optional, Union
def add_domain(domain: str, url: str, secure: bool = ...) -> str: ... def add_domain(domain: str, url: str, secure: bool = ...) -> str: ...
class FeedDoesNotExist(ObjectDoesNotExist): ... class FeedDoesNotExist(ObjectDoesNotExist): ...
@@ -24,9 +25,13 @@ class Feed:
def item_description(self, item: Model) -> str: ... def item_description(self, item: Model) -> str: ...
def item_link(self, item: Model) -> str: ... def item_link(self, item: Model) -> str: ...
def item_enclosures(self, item: Model) -> List[Enclosure]: ... def item_enclosures(self, item: Model) -> List[Enclosure]: ...
def _get_dynamic_attr(self, attname: str, obj: Optional[Model], default: Optional[str] = ...) -> Any: ... def _get_dynamic_attr(
self, attname: str, obj: Optional[Model], default: Optional[str] = ...
) -> Any: ...
def feed_extra_kwargs(self, obj: None) -> Dict[Any, Any]: ... def feed_extra_kwargs(self, obj: None) -> Dict[Any, Any]: ...
def item_extra_kwargs(self, item: Model) -> Dict[Any, Any]: ... def item_extra_kwargs(self, item: Model) -> Dict[Any, Any]: ...
def get_object(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> None: ... def get_object(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> None: ...
def get_context_data(self, **kwargs: Any) -> Dict[str, Model]: ... def get_context_data(self, **kwargs: Any) -> Dict[str, Model]: ...
def get_feed(self, obj: None, request: WSGIRequest) -> Union[Atom1Feed, Rss201rev2Feed]: ... def get_feed(
self, obj: None, request: WSGIRequest
) -> Union[Atom1Feed, Rss201rev2Feed]: ...

View File

@@ -1,22 +1,13 @@
from collections import OrderedDict from collections import OrderedDict
from django.core.cache.backends.base import BaseCache from django.core.cache.backends.base import BaseCache
from typing import ( from typing import Callable, Dict, Union
Callable,
Dict,
Union,
)
def _create_cache(backend: str, **kwargs) -> BaseCache: ... def _create_cache(backend: str, **kwargs) -> BaseCache: ...
def close_caches(**kwargs) -> None: ... def close_caches(**kwargs) -> None: ...
class CacheHandler: class CacheHandler:
def __getitem__(self, alias: str) -> BaseCache: ... def __getitem__(self, alias: str) -> BaseCache: ...
class DefaultCacheProxy: class DefaultCacheProxy:
def __contains__(self, key: str) -> bool: ... def __contains__(self, key: str) -> bool: ...
def __getattr__(self, name: str) -> Union[OrderedDict, Dict[str, float], Callable]: ... def __getattr__(self, name: str) -> Union[OrderedDict, Dict[str, float], Callable]: ...

View File

@@ -7,13 +7,16 @@ from typing import Any, Optional
from collections import OrderedDict from collections import OrderedDict
from typing import Any, Callable, Dict, List, Optional, Union from typing import Any, Callable, Dict, List, Optional, Union
class InvalidCacheBackendError(ImproperlyConfigured): ... class InvalidCacheBackendError(ImproperlyConfigured): ...
class CacheKeyWarning(RuntimeWarning): ... class CacheKeyWarning(RuntimeWarning): ...
DEFAULT_TIMEOUT: Any DEFAULT_TIMEOUT: Any
MEMCACHE_MAX_KEY_LENGTH: int MEMCACHE_MAX_KEY_LENGTH: int
def default_key_func(key: Union[str, int], key_prefix: str, version: Union[str, int]) -> str: ... def default_key_func(
key: Union[str, int], key_prefix: str, version: Union[str, int]
) -> str: ...
def get_key_func(key_func: Optional[Union[str, Callable]]) -> Callable: ... def get_key_func(key_func: Optional[Union[str, Callable]]) -> Callable: ...
class BaseCache: class BaseCache:
@@ -25,22 +28,52 @@ class BaseCache:
key_func: Any = ... key_func: Any = ...
def __init__(self, params: Dict[str, Any]) -> None: ... def __init__(self, params: Dict[str, Any]) -> None: ...
def get_backend_timeout(self, timeout: object = ...) -> Optional[float]: ... def get_backend_timeout(self, timeout: object = ...) -> Optional[float]: ...
def make_key(self, key: Union[str, int], version: Optional[Union[str, int]] = ...) -> str: ... def make_key(
def add(self, key: Any, value: Any, timeout: Any = ..., version: Optional[Any] = ...) -> None: ... self, key: Union[str, int], version: Optional[Union[str, int]] = ...
def get(self, key: Any, default: Optional[Any] = ..., version: Optional[Any] = ...) -> None: ... ) -> str: ...
def set(self, key: Any, value: Any, timeout: Any = ..., version: Optional[Any] = ...) -> None: ... def add(
self, key: Any, value: Any, timeout: Any = ..., version: Optional[Any] = ...
) -> None: ...
def get(
self, key: Any, default: Optional[Any] = ..., version: Optional[Any] = ...
) -> None: ...
def set(
self, key: Any, value: Any, timeout: Any = ..., version: Optional[Any] = ...
) -> None: ...
def touch(self, key: Any, timeout: Any = ..., version: Optional[Any] = ...) -> None: ... def touch(self, key: Any, timeout: Any = ..., version: Optional[Any] = ...) -> None: ...
def delete(self, key: Any, version: Optional[Any] = ...) -> None: ... def delete(self, key: Any, version: Optional[Any] = ...) -> None: ...
def get_many(self, keys: List[str], version: Optional[int] = ...) -> Dict[str, Union[str, int]]: ... def get_many(
def get_or_set(self, key: str, default: Optional[Union[str, int, Callable]], timeout: object = ..., version: Optional[int] = ...) -> Optional[Union[str, int]]: ... self, keys: List[str], version: Optional[int] = ...
) -> Dict[str, Union[str, int]]: ...
def get_or_set(
self,
key: str,
default: Optional[Union[str, int, Callable]],
timeout: object = ...,
version: Optional[int] = ...,
) -> Optional[Union[str, int]]: ...
def has_key(self, key: Any, version: Optional[Any] = ...): ... def has_key(self, key: Any, version: Optional[Any] = ...): ...
def incr(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ... def incr(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ...
def decr(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ... def decr(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ...
def __contains__(self, key: str) -> bool: ... def __contains__(self, key: str) -> bool: ...
def set_many(self, data: Union[Dict[str, Union[Dict[str, int], str]], OrderedDict, Dict[str, str], Dict[str, int]], timeout: object = ..., version: Optional[int] = ...) -> List[Any]: ... def set_many(
self,
data: Union[
Dict[str, Union[Dict[str, int], str]],
OrderedDict,
Dict[str, str],
Dict[str, int],
],
timeout: object = ...,
version: Optional[int] = ...,
) -> List[Any]: ...
def delete_many(self, keys: List[str], version: None = ...) -> None: ... def delete_many(self, keys: List[str], version: None = ...) -> None: ...
def clear(self) -> None: ... def clear(self) -> None: ...
def validate_key(self, key: str) -> None: ... def validate_key(self, key: str) -> None: ...
def incr_version(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ... def incr_version(
def decr_version(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ... self, key: str, delta: int = ..., version: Optional[int] = ...
) -> int: ...
def decr_version(
self, key: str, delta: int = ..., version: Optional[int] = ...
) -> int: ...
def close(self, **kwargs: Any) -> None: ... def close(self, **kwargs: Any) -> None: ...

View File

@@ -8,6 +8,7 @@ from typing import Any, Optional
from datetime import datetime from datetime import datetime
from django.db.backends.utils import CursorWrapper from django.db.backends.utils import CursorWrapper
from typing import Any, Callable, Dict, Optional, Union from typing import Any, Callable, Dict, Optional, Union
class Options: class Options:
db_table: Any = ... db_table: Any = ...
app_label: str = ... app_label: str = ...
@@ -24,13 +25,30 @@ class Options:
class BaseDatabaseCache(BaseCache): class BaseDatabaseCache(BaseCache):
_table: Any = ... _table: Any = ...
cache_model_class: Any = ... cache_model_class: Any = ...
def __init__(self, table: str, params: Dict[str, Union[Callable, Dict[str, int], str, int]]) -> None: ... def __init__(
self, table: str, params: Dict[str, Union[Callable, Dict[str, int], str, int]]
) -> None: ...
class DatabaseCache(BaseDatabaseCache): class DatabaseCache(BaseDatabaseCache):
def get(self, key: str, default: Optional[Union[str, int]] = ..., version: Optional[int] = ...) -> Any: ... def get(
def set(self, key: str, value: Any, timeout: object = ..., version: Optional[int] = ...) -> None: ... self,
def add(self, key: str, value: Union[str, bytes, Dict[str, int], int], timeout: object = ..., version: Optional[int] = ...) -> bool: ... key: str,
def touch(self, key: str, timeout: Optional[int] = ..., version: None = ...) -> bool: ... default: Optional[Union[str, int]] = ...,
version: Optional[int] = ...,
) -> Any: ...
def set(
self, key: str, value: Any, timeout: object = ..., version: Optional[int] = ...
) -> None: ...
def add(
self,
key: str,
value: Union[str, bytes, Dict[str, int], int],
timeout: object = ...,
version: Optional[int] = ...,
) -> bool: ...
def touch(
self, key: str, timeout: Optional[int] = ..., version: None = ...
) -> bool: ...
def _base_set(self, mode: str, key: str, value: object, timeout: object = ...): ... def _base_set(self, mode: str, key: str, value: object, timeout: object = ...): ...
def delete(self, key: str, version: Optional[int] = ...) -> None: ... def delete(self, key: str, version: Optional[int] = ...) -> None: ...
def has_key(self, key: str, version: Optional[int] = ...): ... def has_key(self, key: str, version: Optional[int] = ...): ...

Some files were not shown because too many files have changed in this diff Show More