mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 05:24:53 +08:00
reformat with black
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1 +1,4 @@
|
||||
*.egg-info
|
||||
*.egg-info
|
||||
__pycache__/
|
||||
out/
|
||||
/test_sqlite.py
|
||||
@@ -6,6 +6,7 @@ from typing import Any
|
||||
|
||||
from django.db.models.base import Model
|
||||
from typing import Any, Iterator, Type
|
||||
|
||||
MODELS_MODULE_NAME: str
|
||||
|
||||
class AppConfig:
|
||||
@@ -23,6 +24,8 @@ class AppConfig:
|
||||
@classmethod
|
||||
def create(cls, entry: str) -> AppConfig: ...
|
||||
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 ready(self) -> None: ...
|
||||
|
||||
@@ -9,6 +9,7 @@ from django.apps.config import AppConfig
|
||||
from django.db.migrations.state import AppConfigStub
|
||||
from django.db.models.base import Model
|
||||
from typing import List, Optional, Tuple, Type, Union
|
||||
|
||||
class Apps:
|
||||
all_models: Any = ...
|
||||
app_configs: Any = ...
|
||||
@@ -17,7 +18,9 @@ class Apps:
|
||||
_lock: Any = ...
|
||||
loading: bool = ...
|
||||
_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 = ...
|
||||
ready: bool = ...
|
||||
def populate(self, installed_apps: Optional[Any] = ...): ...
|
||||
@@ -26,7 +29,9 @@ class Apps:
|
||||
def get_app_configs(self): ...
|
||||
def get_app_config(self, app_label: str) -> AppConfig: ...
|
||||
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 is_installed(self, app_name: Any): ...
|
||||
def get_containing_app_config(self, object_name: str) -> Optional[AppConfig]: ...
|
||||
|
||||
@@ -6,7 +6,9 @@ from django.utils.functional import LazyObject
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, List
|
||||
|
||||
ENVIRONMENT_VARIABLE: str
|
||||
|
||||
class LazySettings(LazyObject):
|
||||
_wrapped: Any = ...
|
||||
def _setup(self, name: None = ...) -> None: ...
|
||||
|
||||
@@ -7,9 +7,12 @@ from typing import Any, Optional
|
||||
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
handler400: Any
|
||||
handler403: Any
|
||||
handler404: 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]: ...
|
||||
|
||||
@@ -6,7 +6,10 @@ from typing import Any
|
||||
|
||||
from django.urls.resolvers import URLResolver
|
||||
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]: ...
|
||||
|
||||
urlpatterns: Any
|
||||
|
||||
@@ -6,4 +6,5 @@ from typing import Any
|
||||
|
||||
from django.urls.resolvers import URLPattern
|
||||
from typing import Callable, List
|
||||
|
||||
def static(prefix: str, view: Callable = ..., **kwargs: Any) -> List[URLPattern]: ...
|
||||
|
||||
@@ -3,9 +3,25 @@
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
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.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
|
||||
|
||||
def autodiscover() -> None: ...
|
||||
|
||||
@@ -8,4 +8,7 @@ from django.contrib.admin.options import ModelAdmin
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.query import QuerySet
|
||||
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: ...
|
||||
|
||||
@@ -9,37 +9,113 @@ from django.contrib.auth.models import Group, User
|
||||
from django.core.checks.messages import Error
|
||||
from django.db.models.base import Model
|
||||
from typing import Any, List, Tuple, Type, Union
|
||||
|
||||
def check_admin_app(app_configs: Any, **kwargs: Any): ...
|
||||
def check_dependencies(**kwargs: Any): ...
|
||||
|
||||
class BaseModelAdminChecks:
|
||||
def check(self, admin_obj: Union[ModelAdmin, InlineModelAdmin], **kwargs: Any) -> List[Error]: ...
|
||||
def _check_autocomplete_fields(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(
|
||||
self, admin_obj: Union[ModelAdmin, InlineModelAdmin], **kwargs: Any
|
||||
) -> List[Error]: ...
|
||||
def _check_autocomplete_fields(
|
||||
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_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_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_fieldsets_item(
|
||||
self,
|
||||
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_form(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
|
||||
def _check_filter_vertical(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
|
||||
def _check_filter_horizontal(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_filter_vertical(
|
||||
self, obj: Union[ModelAdmin, InlineModelAdmin]
|
||||
) -> List[Any]: ...
|
||||
def _check_filter_horizontal(
|
||||
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_view_on_site_url(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
|
||||
def _check_prepopulated_fields(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_view_on_site_url(
|
||||
self, obj: Union[ModelAdmin, InlineModelAdmin]
|
||||
) -> List[Any]: ...
|
||||
def _check_prepopulated_fields(
|
||||
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_item(self, obj: ModelAdmin, model: Type[Model], field_name: str, label: str) -> 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]: ...
|
||||
def _check_ordering_item(
|
||||
self, obj: ModelAdmin, model: Type[Model], field_name: str, label: str
|
||||
) -> 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):
|
||||
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_max_show_all(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_date_hierarchy(self, obj: Any): ...
|
||||
def _check_action_permission_methods(self, obj: Any): ...
|
||||
|
||||
class InlineModelAdminChecks(BaseModelAdminChecks):
|
||||
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_relation(self, obj: InlineModelAdmin, parent_model: Type[Model]) -> List[Any]: ...
|
||||
def _check_exclude_of_parent_model(
|
||||
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_max_num(self, obj: InlineModelAdmin) -> List[Any]: ...
|
||||
def _check_min_num(self, obj: InlineModelAdmin) -> List[Any]: ...
|
||||
|
||||
@@ -5,4 +5,5 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Callable
|
||||
|
||||
def register(*models: Any, site: Optional[Any] = ...) -> Callable: ...
|
||||
|
||||
@@ -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.query import QuerySet
|
||||
from typing import Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
class ListFilter:
|
||||
title: Any = ...
|
||||
template: str = ...
|
||||
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 choices(self, changelist: Any) -> None: ...
|
||||
def queryset(self, request: Any, queryset: Any) -> None: ...
|
||||
@@ -25,7 +32,13 @@ class ListFilter:
|
||||
class SimpleListFilter(ListFilter):
|
||||
parameter_name: 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 value(self) -> Optional[str]: ...
|
||||
def lookups(self, request: Any, model_admin: Any) -> None: ...
|
||||
@@ -38,13 +51,34 @@ class FieldListFilter(ListFilter):
|
||||
field: Any = ...
|
||||
field_path: 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 queryset(self, request: WSGIRequest, queryset: QuerySet) -> QuerySet: ...
|
||||
@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
|
||||
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):
|
||||
lookup_kwarg: Any = ...
|
||||
@@ -55,12 +89,25 @@ class RelatedFieldListFilter(FieldListFilter):
|
||||
lookup_title: Any = ...
|
||||
title: 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
|
||||
def include_empty_choice(self) -> bool: ...
|
||||
def has_output(self) -> bool: ...
|
||||
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: ...
|
||||
|
||||
class BooleanFieldListFilter(FieldListFilter):
|
||||
@@ -68,7 +115,15 @@ class BooleanFieldListFilter(FieldListFilter):
|
||||
lookup_kwarg2: Any = ...
|
||||
lookup_val: 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 choices(self, changelist: Any) -> None: ...
|
||||
|
||||
@@ -77,7 +132,15 @@ class ChoicesFieldListFilter(FieldListFilter):
|
||||
lookup_kwarg_isnull: Any = ...
|
||||
lookup_val: 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 choices(self, changelist: Any) -> None: ...
|
||||
|
||||
@@ -88,7 +151,15 @@ class DateFieldListFilter(FieldListFilter):
|
||||
lookup_kwarg_until: Any = ...
|
||||
links: 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 choices(self, changelist: Any) -> None: ...
|
||||
|
||||
@@ -99,9 +170,22 @@ class AllValuesFieldListFilter(FieldListFilter):
|
||||
lookup_val_isnull: Any = ...
|
||||
empty_value_display: 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 choices(self, changelist: Any) -> None: ...
|
||||
|
||||
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]]]: ...
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
class AdminAuthenticationForm:
|
||||
def confirm_login_allowed(self, user: User) -> None: ...
|
||||
def confirm_login_allowed(self, user: User) -> None: ...
|
||||
|
||||
@@ -11,6 +11,7 @@ from django.forms.utils import ErrorDict
|
||||
from django.forms.widgets import Media
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Callable, Dict, Iterator, List, Tuple, Union
|
||||
|
||||
ACTION_CHECKBOX_NAME: str
|
||||
|
||||
class ActionForm(forms.Form):
|
||||
@@ -23,7 +24,14 @@ class AdminForm:
|
||||
prepopulated_fields: Any = ...
|
||||
model_admin: 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]: ...
|
||||
@property
|
||||
def errors(self) -> ErrorDict: ...
|
||||
@@ -38,7 +46,16 @@ class Fieldset:
|
||||
description: Any = ...
|
||||
model_admin: 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
|
||||
def media(self) -> Media: ...
|
||||
def __iter__(self) -> Iterator[Fieldline]: ...
|
||||
@@ -49,7 +66,13 @@ class Fieldline:
|
||||
has_visible_field: Any = ...
|
||||
model_admin: 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 errors(self) -> SafeText: ...
|
||||
|
||||
@@ -70,7 +93,9 @@ class AdminReadonlyField:
|
||||
is_checkbox: bool = ...
|
||||
is_readonly: bool = ...
|
||||
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 contents(self) -> SafeText: ...
|
||||
|
||||
@@ -86,7 +111,19 @@ class InlineAdminFormSet:
|
||||
has_change_permission: Any = ...
|
||||
has_delete_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 fields(self) -> Iterator[Dict[str, Any]]: ...
|
||||
def inline_formset_data(self) -> str: ...
|
||||
@@ -103,7 +140,17 @@ class InlineAdminForm(AdminForm):
|
||||
original: Any = ...
|
||||
show_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 needs_explicit_pk_field(self) -> Union[bool, AutoField]: ...
|
||||
def pk_field(self) -> AdminField: ...
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from typing import Any
|
||||
|
||||
|
||||
class LogEntry:
|
||||
def __str__(self) -> str: ...
|
||||
def get_admin_url(self) -> str: ...
|
||||
@@ -9,7 +8,6 @@ class LogEntry:
|
||||
def is_change(self) -> bool: ...
|
||||
def is_deletion(self) -> bool: ...
|
||||
|
||||
|
||||
class LogEntryManager:
|
||||
def log_action(
|
||||
self,
|
||||
@@ -18,5 +16,5 @@ class LogEntryManager:
|
||||
object_id: int,
|
||||
object_repr: str,
|
||||
action_flag: int,
|
||||
change_message: Any = ...
|
||||
) -> LogEntry: ...
|
||||
change_message: Any = ...,
|
||||
) -> LogEntry: ...
|
||||
|
||||
@@ -14,6 +14,7 @@ from django.forms.fields import Field, TypedChoiceField
|
||||
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
IS_POPUP_VAR: str
|
||||
TO_FIELD_VAR: str
|
||||
HORIZONTAL: Any
|
||||
@@ -47,28 +48,50 @@ class BaseModelAdmin:
|
||||
checks_class: Any = ...
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
def __init__(self) -> None: ...
|
||||
def formfield_for_dbfield(self, db_field: Field, request: object, **kwargs: Any) -> Optional[Field]: ...
|
||||
def formfield_for_choice_field(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 formfield_for_dbfield(
|
||||
self, db_field: Field, request: object, **kwargs: Any
|
||||
) -> Optional[Field]: ...
|
||||
def formfield_for_choice_field(
|
||||
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_view_on_site_url(self, obj: Optional[Model] = ...) -> Optional[str]: ...
|
||||
def get_empty_value_display(self) -> SafeText: ...
|
||||
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_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
||||
def get_readonly_fields(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_readonly_fields(
|
||||
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_sortable_by(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
||||
def lookup_allowed(self, lookup: Any, value: Any): ...
|
||||
def to_field_allowed(self, request: Any, to_field: Any): ...
|
||||
def has_add_permission(self, request: WSGIRequest) -> bool: ...
|
||||
def has_change_permission(self, request: object, obj: Optional[Model] = ...) -> 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_change_permission(
|
||||
self, request: object, obj: Optional[Model] = ...
|
||||
) -> 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: ...
|
||||
|
||||
class ModelAdmin(BaseModelAdmin):
|
||||
@@ -113,14 +136,23 @@ class ModelAdmin(BaseModelAdmin):
|
||||
def media(self): ...
|
||||
def get_model_perms(self, request: 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_instance(self, request: 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_formset(self, request: Any, **kwargs: Any): ...
|
||||
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_change(self, request: Any, object: Any, message: 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_results(self, request: Any, queryset: Any, search_term: Any): ...
|
||||
def get_preserved_filters(self, request: Any): ...
|
||||
def construct_change_message(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 construct_change_message(
|
||||
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_model(self, request: Any, obj: Any, form: Any, change: Any) -> None: ...
|
||||
def delete_model(self, request: Any, obj: 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_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 response_add(self, request: Any, obj: Any, post_url_continue: Optional[Any] = ...): ...
|
||||
def render_change_form(
|
||||
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_post_save_add(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_delete(self, request: Any, obj_display: Any, obj_id: 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_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(self, request: Any, object_id: Any, form_url: Any, extra_context: Any): ...
|
||||
def changeform_view(
|
||||
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 add_view(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 add_view(
|
||||
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_list_editable_queryset(self, request: Any, prefix: Any): ...
|
||||
def changelist_view(self, request: Any, extra_context: Optional[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 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): ...
|
||||
|
||||
class InlineModelAdmin(BaseModelAdmin):
|
||||
|
||||
@@ -11,6 +11,7 @@ from django.http.response import HttpResponse, HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
from typing import Any, Callable, Dict, List, Tuple, Type, Union
|
||||
|
||||
all_sites: Any
|
||||
|
||||
class AlreadyRegistered(Exception): ...
|
||||
@@ -35,7 +36,9 @@ class AdminSite:
|
||||
_global_actions: Any = ...
|
||||
def __init__(self, name: str = ...) -> None: ...
|
||||
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 is_registered(self, model: Type[Model]) -> bool: ...
|
||||
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 get_urls(self) -> List[Union[URLPattern, URLResolver]]: ...
|
||||
@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 password_change(self, request: WSGIRequest, extra_context: Dict[str, str] = ...) -> TemplateResponse: ...
|
||||
def password_change_done(self, request: WSGIRequest, extra_context: None = ...) -> 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 password_change(
|
||||
self, request: WSGIRequest, extra_context: Dict[str, str] = ...
|
||||
) -> TemplateResponse: ...
|
||||
def password_change_done(
|
||||
self, request: WSGIRequest, extra_context: None = ...
|
||||
) -> 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 index(self, request: WSGIRequest, extra_context: None = ...) -> TemplateResponse: ...
|
||||
def app_index(self, request: WSGIRequest, app_label: str, extra_context: None = ...) -> TemplateResponse: ...
|
||||
def index(
|
||||
self, request: WSGIRequest, extra_context: None = ...
|
||||
) -> TemplateResponse: ...
|
||||
def app_index(
|
||||
self, request: WSGIRequest, app_label: str, extra_context: None = ...
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
class DefaultAdminSite(LazyObject):
|
||||
_wrapped: Any = ...
|
||||
|
||||
@@ -14,6 +14,7 @@ from django.template.base import Parser, Token
|
||||
from django.template.context import RequestContext
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Callable, Dict, Iterator, Optional, Union
|
||||
|
||||
register: Any
|
||||
DOT: str
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ from django.contrib.admin.helpers import InlineAdminForm
|
||||
from django.contrib.admin.templatetags.base import InclusionAdminNode
|
||||
from django.template.base import Parser, Token
|
||||
from django.template.context import Context, RequestContext
|
||||
|
||||
register: Any
|
||||
|
||||
def prepopulated_fields_js(context: RequestContext) -> RequestContext: ...
|
||||
|
||||
@@ -9,8 +9,14 @@ from django.template.context import RequestContext
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Dict, Optional, Union
|
||||
from uuid import UUID
|
||||
|
||||
register: Any
|
||||
|
||||
def admin_urlname(value: Options, arg: SafeText) -> str: ...
|
||||
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: ...
|
||||
|
||||
@@ -9,7 +9,15 @@ from django.template.base import Parser, Token
|
||||
from django.template.context import Context
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Callable
|
||||
|
||||
class InclusionAdminNode(InclusionNode):
|
||||
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: ...
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
from django.template.base import (
|
||||
Parser,
|
||||
Token,
|
||||
)
|
||||
from django.template.base import Parser, Token
|
||||
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:
|
||||
def __init__(self, limit: str, varname: str, user: str) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
@@ -11,18 +11,28 @@ from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||
from django.contrib.auth.models import User
|
||||
from django.db.models.base import Model
|
||||
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.query import QuerySet
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
class FieldIsAForeignKeyColumnName(Exception): ...
|
||||
|
||||
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 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 get_deleted_objects(objs: Any, request: Any, admin_site: Any): ...
|
||||
|
||||
@@ -32,24 +42,49 @@ class NestedObjects(Collector):
|
||||
model_objs: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> 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 related_objects(self, related: ManyToOneRel, objs: Union[List[User], List[Model]]) -> QuerySet: ...
|
||||
def collect(
|
||||
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, format_callback: Callable = ...) -> Any: ...
|
||||
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ...
|
||||
|
||||
def model_format_dict(obj: Any): ...
|
||||
def model_ngettext(obj: QuerySet, n: None = ...) -> str: ...
|
||||
def lookup_field(name: Union[str, Callable], 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 lookup_field(
|
||||
name: Union[str, Callable],
|
||||
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 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: ...
|
||||
|
||||
class NotRelationField(Exception): ...
|
||||
|
||||
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 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]]]]: ...
|
||||
|
||||
@@ -9,6 +9,7 @@ from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.core.paginator import Paginator
|
||||
from django.db.models.query import QuerySet
|
||||
from django.http.response import JsonResponse
|
||||
|
||||
class AutocompleteJsonView(BaseListView):
|
||||
paginate_by: int = ...
|
||||
model_admin: Any = ...
|
||||
|
||||
@@ -5,4 +5,7 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
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: ...
|
||||
|
||||
@@ -12,6 +12,7 @@ from django.db.models.base import Model
|
||||
from django.db.models.expressions import CombinedExpression
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
ALL_VAR: str
|
||||
ORDER_VAR: str
|
||||
ORDER_TYPE_VAR: str
|
||||
@@ -46,10 +47,29 @@ class ChangeList:
|
||||
queryset: Any = ...
|
||||
title: 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(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 = ...
|
||||
show_full_result_count: Any = ...
|
||||
show_admin_actions: Any = ...
|
||||
@@ -60,7 +80,9 @@ class ChangeList:
|
||||
paginator: Any = ...
|
||||
def get_results(self, request: WSGIRequest) -> None: ...
|
||||
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_field_columns(self) -> OrderedDict: ...
|
||||
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
||||
|
||||
@@ -12,12 +12,15 @@ from django.forms.widgets import Media, Select
|
||||
from django.http.request import QueryDict
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple, Union
|
||||
|
||||
class FilteredSelectMultiple(forms.SelectMultiple):
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
verbose_name: 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): ...
|
||||
|
||||
class AdminDateWidget(forms.DateInput):
|
||||
@@ -33,7 +36,33 @@ class AdminTimeWidget(forms.TimeInput):
|
||||
class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
||||
template_name: str = ...
|
||||
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):
|
||||
template_name: str = ...
|
||||
@@ -48,8 +77,14 @@ class ForeignKeyRawIdWidget(forms.TextInput):
|
||||
rel: Any = ...
|
||||
admin_site: Any = ...
|
||||
db: Any = ...
|
||||
def __init__(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 __init__(
|
||||
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 url_parameters(self) -> Dict[str, str]: ...
|
||||
def label_and_url_for_value(self, value: Any): ...
|
||||
@@ -74,15 +109,28 @@ class RelatedFieldWidgetWrapper(forms.Widget):
|
||||
can_delete_related: Any = ...
|
||||
can_view_related: 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: ...
|
||||
@property
|
||||
def is_hidden(self) -> bool: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
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 value_from_datadict(self, data: QueryDict, files: MultiValueDict, name: str) -> Optional[str]: ...
|
||||
def get_context(
|
||||
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 id_for_label(self, id_: str) -> str: ...
|
||||
|
||||
@@ -98,7 +146,9 @@ class AdminEmailInputWidget(forms.EmailInput):
|
||||
class AdminURLFieldWidget(forms.URLInput):
|
||||
template_name: str = ...
|
||||
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_name: str = ...
|
||||
@@ -116,10 +166,24 @@ class AutocompleteMixin:
|
||||
db: Any = ...
|
||||
choices: 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 build_attrs(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]]]: ...
|
||||
def build_attrs(
|
||||
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
|
||||
def media(self) -> Media: ...
|
||||
|
||||
|
||||
@@ -9,5 +9,12 @@ from typing import Any
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
from typing import Any, Callable, Dict, Optional, Tuple
|
||||
|
||||
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]: ...
|
||||
|
||||
@@ -5,17 +5,28 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Callable
|
||||
|
||||
docutils_is_available: bool
|
||||
|
||||
def get_view_name(view_func: Callable) -> str: ...
|
||||
def trim_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
|
||||
|
||||
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
|
||||
unnamed_group_matcher: Any
|
||||
|
||||
@@ -7,6 +7,7 @@ from django.views.generic import TemplateView
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.models.fields import Field
|
||||
|
||||
MODEL_METHODS_EXCLUDE: Any
|
||||
|
||||
class BaseAdminDocsView(TemplateView):
|
||||
@@ -50,5 +51,7 @@ class TemplateDetailView(BaseAdminDocsView):
|
||||
|
||||
def get_return_data_type(func_name: Any): ...
|
||||
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): ...
|
||||
|
||||
@@ -14,6 +14,7 @@ from django.db.models.options import Options
|
||||
from django.http.request import HttpRequest
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
from typing import Any, Dict, List, Optional, Type, Union
|
||||
|
||||
SESSION_KEY: str
|
||||
BACKEND_SESSION_KEY: str
|
||||
HASH_SESSION_KEY: str
|
||||
@@ -22,10 +23,18 @@ REDIRECT_FIELD_NAME: str
|
||||
def load_backend(path: str) -> object: ...
|
||||
def _get_backends(return_tuples: bool = ...) -> Any: ...
|
||||
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 authenticate(request: Optional[HttpRequest] = ..., **credentials: Any) -> Optional[AbstractBaseUser]: ...
|
||||
def login(request: HttpRequest, user: User, backend: Optional[Union[str, Type[ModelBackend]]] = ...) -> None: ...
|
||||
def authenticate(
|
||||
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 get_user_model() -> Type[Model]: ...
|
||||
def get_user(request: HttpRequest) -> Union[AnonymousUser, AbstractBaseUser]: ...
|
||||
|
||||
@@ -5,52 +5,28 @@ from django.forms.models import ModelMultipleChoiceField
|
||||
from django.http.response import HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.urls.resolvers import URLPattern
|
||||
from typing import (
|
||||
Dict,
|
||||
List,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
|
||||
from typing import Dict, List, Tuple, Union
|
||||
|
||||
class GroupAdmin:
|
||||
def formfield_for_manytomany(
|
||||
self,
|
||||
db_field: ManyToManyField,
|
||||
request: WSGIRequest = ...,
|
||||
**kwargs
|
||||
self, db_field: ManyToManyField, request: WSGIRequest = ..., **kwargs
|
||||
) -> ModelMultipleChoiceField: ...
|
||||
|
||||
|
||||
class UserAdmin:
|
||||
def _add_view(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
form_url: str = ...,
|
||||
extra_context: None = ...
|
||||
self, request: WSGIRequest, form_url: str = ..., extra_context: None = ...
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
def add_view(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
form_url: str = ...,
|
||||
extra_context: None = ...
|
||||
self, request: WSGIRequest, form_url: str = ..., extra_context: None = ...
|
||||
): ...
|
||||
def get_fieldsets(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
obj: None = ...
|
||||
self, request: WSGIRequest, obj: None = ...
|
||||
) -> Tuple[Tuple[None, Dict[str, Union[Tuple[str], Tuple[str, str, str]]]]]: ...
|
||||
def get_urls(self) -> List[URLPattern]: ...
|
||||
def lookup_allowed(self, lookup: str, value: str) -> bool: ...
|
||||
def response_add(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
obj: User,
|
||||
post_url_continue: None = ...
|
||||
self, request: WSGIRequest, obj: User, post_url_continue: None = ...
|
||||
) -> HttpResponseRedirect: ...
|
||||
def user_change_password(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
id: str,
|
||||
form_url: str = ...
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
self, request: WSGIRequest, id: str, form_url: str = ...
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
|
||||
@@ -1,26 +1,16 @@
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.contrib.auth.models import (
|
||||
AnonymousUser,
|
||||
User,
|
||||
)
|
||||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.query import QuerySet
|
||||
from django.http.request import HttpRequest
|
||||
from typing import (
|
||||
Optional,
|
||||
Set,
|
||||
Union,
|
||||
)
|
||||
|
||||
from typing import Optional, Set, Union
|
||||
|
||||
class AllowAllUsersModelBackend:
|
||||
def user_can_authenticate(self, user: User) -> bool: ...
|
||||
|
||||
|
||||
class AllowAllUsersRemoteUserBackend:
|
||||
def user_can_authenticate(self, user: User) -> bool: ...
|
||||
|
||||
|
||||
class ModelBackend:
|
||||
def _get_group_permissions(self, user_obj: User) -> QuerySet: ...
|
||||
def _get_permissions(self, user_obj: User, obj: None, from_name: str) -> Set[str]: ...
|
||||
@@ -30,31 +20,23 @@ class ModelBackend:
|
||||
request: Optional[HttpRequest],
|
||||
username: Optional[str] = ...,
|
||||
password: Optional[str] = ...,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
) -> Optional[User]: ...
|
||||
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_user(self, user_id: int) -> User: ...
|
||||
def get_user_permissions(self, user_obj: User, obj: None = ...) -> Set[str]: ...
|
||||
def has_module_perms(
|
||||
self,
|
||||
user_obj: Union[AnonymousUser, User],
|
||||
app_label: str
|
||||
self, user_obj: Union[AnonymousUser, User], app_label: str
|
||||
) -> bool: ...
|
||||
def has_perm(
|
||||
self,
|
||||
user_obj: Union[AnonymousUser, User],
|
||||
perm: str,
|
||||
obj: None = ...
|
||||
self, user_obj: Union[AnonymousUser, User], perm: str, obj: None = ...
|
||||
) -> bool: ...
|
||||
def user_can_authenticate(self, user: Optional[AbstractBaseUser]) -> bool: ...
|
||||
|
||||
|
||||
class RemoteUserBackend:
|
||||
def authenticate(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
remote_user: Optional[str]
|
||||
self, request: WSGIRequest, remote_user: Optional[str]
|
||||
) -> Optional[User]: ...
|
||||
def clean_username(self, username: str) -> str: ...
|
||||
def configure_user(self, user: User) -> User: ...
|
||||
def configure_user(self, user: User) -> User: ...
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class AbstractBaseUser:
|
||||
def __str__(self) -> str: ...
|
||||
def check_password(self, raw_password: str) -> bool: ...
|
||||
@@ -20,8 +19,7 @@ class AbstractBaseUser:
|
||||
def set_password(self, raw_password: Optional[str]) -> None: ...
|
||||
def set_unusable_password(self) -> None: ...
|
||||
|
||||
|
||||
class BaseUserManager:
|
||||
def get_by_natural_key(self, username: Optional[str]) -> AbstractBaseUser: ...
|
||||
@classmethod
|
||||
def normalize_email(cls, email: Optional[str]) -> str: ...
|
||||
def normalize_email(cls, email: Optional[str]) -> str: ...
|
||||
|
||||
@@ -6,5 +6,6 @@ from .management import _get_builtin_permissions
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, List
|
||||
|
||||
def check_user_model(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
def check_models_permissions(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
|
||||
@@ -7,6 +7,7 @@ from typing import Any
|
||||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Dict, Union
|
||||
|
||||
class PermLookupDict:
|
||||
def __init__(self, user: object, app_label: str) -> None: ...
|
||||
def __repr__(self): ...
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
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 permission_required(perm: Union[str, List[str]], login_url: None = ..., raise_exception: bool = ...) -> Callable: ...
|
||||
|
||||
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 permission_required(
|
||||
perm: Union[str, List[str]], login_url: None = ..., raise_exception: bool = ...
|
||||
) -> Callable: ...
|
||||
|
||||
@@ -2,15 +2,7 @@ from django.contrib.auth.models import User
|
||||
from django.contrib.auth.tokens import PasswordResetTokenGenerator
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Iterator,
|
||||
List,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
from typing import Any, Dict, Iterator, List, Optional, Union
|
||||
|
||||
class AdminPasswordChangeForm:
|
||||
def __init__(self, user: User, *args, **kwargs) -> None: ...
|
||||
@@ -19,7 +11,6 @@ class AdminPasswordChangeForm:
|
||||
def clean_password2(self) -> str: ...
|
||||
def save(self, commit: bool = ...) -> User: ...
|
||||
|
||||
|
||||
class AuthenticationForm:
|
||||
def __init__(self, request: object = ..., *args, **kwargs) -> None: ...
|
||||
def clean(self) -> Dict[str, str]: ...
|
||||
@@ -27,11 +18,9 @@ class AuthenticationForm:
|
||||
def get_invalid_login_error(self) -> ValidationError: ...
|
||||
def get_user(self) -> User: ...
|
||||
|
||||
|
||||
class PasswordChangeForm:
|
||||
def clean_old_password(self) -> str: ...
|
||||
|
||||
|
||||
class PasswordResetForm:
|
||||
def get_users(self, email: str) -> Iterator[Any]: ...
|
||||
def save(
|
||||
@@ -44,7 +33,7 @@ class PasswordResetForm:
|
||||
from_email: None = ...,
|
||||
request: Optional[WSGIRequest] = ...,
|
||||
html_email_template_name: None = ...,
|
||||
extra_email_context: Optional[Dict[str, str]] = ...
|
||||
extra_email_context: Optional[Dict[str, str]] = ...,
|
||||
) -> None: ...
|
||||
def send_mail(
|
||||
self,
|
||||
@@ -53,41 +42,34 @@ class PasswordResetForm:
|
||||
context: Dict[str, Union[str, User]],
|
||||
from_email: Optional[str],
|
||||
to_email: str,
|
||||
html_email_template_name: None = ...
|
||||
html_email_template_name: None = ...,
|
||||
) -> None: ...
|
||||
|
||||
|
||||
class ReadOnlyPasswordHashField:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def has_changed(self, initial: str, data: None) -> bool: ...
|
||||
|
||||
|
||||
class ReadOnlyPasswordHashWidget:
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: str,
|
||||
attrs: Dict[str, str]
|
||||
) -> Dict[str, Union[Dict[str, Union[str, bool, Dict[str, str]]], List[Dict[str, str]]]]: ...
|
||||
|
||||
self, name: str, value: str, attrs: Dict[str, str]
|
||||
) -> Dict[
|
||||
str, Union[Dict[str, Union[str, bool, Dict[str, str]]], List[Dict[str, str]]]
|
||||
]: ...
|
||||
|
||||
class SetPasswordForm:
|
||||
def __init__(self, user: Optional[User], *args, **kwargs) -> None: ...
|
||||
def clean_new_password2(self) -> str: ...
|
||||
def save(self, commit: bool = ...) -> User: ...
|
||||
|
||||
|
||||
class UserChangeForm:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def clean_password(self) -> str: ...
|
||||
|
||||
|
||||
class UserCreationForm:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def _post_clean(self) -> None: ...
|
||||
def clean_password2(self) -> str: ...
|
||||
def save(self, commit: bool = ...) -> User: ...
|
||||
|
||||
|
||||
class UsernameField:
|
||||
def to_python(self, value: Optional[str]) -> str: ...
|
||||
def to_python(self, value: Optional[str]) -> str: ...
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
)
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
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): ...
|
||||
|
||||
@@ -6,13 +6,23 @@ from typing import Any, Optional
|
||||
|
||||
from collections import OrderedDict
|
||||
from typing import Callable, Dict, List, Optional, Union
|
||||
|
||||
UNUSABLE_PASSWORD_PREFIX: str
|
||||
UNUSABLE_PASSWORD_SUFFIX_LENGTH: int
|
||||
|
||||
def is_password_usable(encoded: Optional[str]) -> bool: ...
|
||||
def check_password(password: str, encoded: str, setter: Optional[Callable] = ..., preferred: str = ...) -> 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 check_password(
|
||||
password: str, encoded: str, setter: Optional[Callable] = ..., preferred: str = ...
|
||||
) -> 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 reset_hashers(**kwargs: Any) -> None: ...
|
||||
def get_hasher(algorithm: str = ...) -> BasePasswordHasher: ...
|
||||
|
||||
@@ -8,8 +8,16 @@ from django.apps.config import AppConfig
|
||||
from django.apps.registry import Apps
|
||||
from django.db.models.options import Options
|
||||
from typing import List, Tuple
|
||||
|
||||
def _get_all_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_default_username(check_db: bool = ...) -> str: ...
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, *args, **options) -> str: ...
|
||||
def handle(self, *args, **options) -> str: ...
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
from django.core.management.base import CommandParser
|
||||
from django.db.models.fields import CharField
|
||||
from django.db.models.fields.related import ForeignKey
|
||||
from typing import (
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
from typing import Optional, Union
|
||||
|
||||
class Command:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
@@ -15,6 +11,6 @@ class Command:
|
||||
self,
|
||||
field: Union[CharField, related.ForeignKey],
|
||||
message: str,
|
||||
default: Optional[str] = ...
|
||||
default: Optional[str] = ...,
|
||||
) -> Optional[str]: ...
|
||||
def handle(self, *args, **options) -> None: ...
|
||||
def handle(self, *args, **options) -> None: ...
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
from django.contrib.auth.models import (
|
||||
AnonymousUser,
|
||||
User,
|
||||
)
|
||||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Union
|
||||
|
||||
|
||||
def get_user(
|
||||
request: HttpRequest
|
||||
) -> Union[AnonymousUser, User]: ...
|
||||
|
||||
def get_user(request: HttpRequest) -> Union[AnonymousUser, User]: ...
|
||||
|
||||
class AuthenticationMiddleware:
|
||||
def process_request(self, request: HttpRequest) -> None: ...
|
||||
|
||||
|
||||
class RemoteUserMiddleware:
|
||||
def _remove_invalid_user(self, request: WSGIRequest) -> None: ...
|
||||
def clean_username(self, username: str, request: WSGIRequest) -> str: ...
|
||||
def process_request(self, request: WSGIRequest) -> None: ...
|
||||
def process_request(self, request: WSGIRequest) -> None: ...
|
||||
|
||||
@@ -1,30 +1,18 @@
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
from typing import (
|
||||
Callable,
|
||||
List,
|
||||
)
|
||||
|
||||
from typing import Callable, List
|
||||
|
||||
class AccessMixin:
|
||||
def get_permission_denied_message(self) -> str: ...
|
||||
def get_redirect_field_name(self) -> str: ...
|
||||
def handle_no_permission(self): ...
|
||||
|
||||
|
||||
class LoginRequiredMixin:
|
||||
def dispatch(self, request: WSGIRequest, *args, **kwargs): ...
|
||||
|
||||
|
||||
class PermissionRequiredMixin:
|
||||
def dispatch(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> HttpResponse: ...
|
||||
def dispatch(self, request: WSGIRequest, *args, **kwargs) -> HttpResponse: ...
|
||||
def get_permission_required(self) -> List[str]: ...
|
||||
|
||||
|
||||
class UserPassesTestMixin:
|
||||
def get_test_func(self) -> Callable: ...
|
||||
def get_test_func(self) -> Callable: ...
|
||||
|
||||
@@ -1,98 +1,65 @@
|
||||
from typing import (
|
||||
List,
|
||||
Optional,
|
||||
Set,
|
||||
Tuple,
|
||||
Type,
|
||||
Union,
|
||||
)
|
||||
|
||||
from typing import List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
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(
|
||||
user: Union[AnonymousUser, User],
|
||||
perm: str,
|
||||
obj: Optional[str]
|
||||
user: Union[AnonymousUser, User], perm: str, obj: Optional[str]
|
||||
) -> 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:
|
||||
def clean(self) -> None: ...
|
||||
def get_short_name(self) -> str: ...
|
||||
|
||||
|
||||
class AnonymousUser:
|
||||
def __str__(self) -> str: ...
|
||||
def delete(self): ...
|
||||
def get_username(self) -> str: ...
|
||||
def has_module_perms(self, module: str) -> 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
|
||||
def is_anonymous(self) -> bool: ...
|
||||
@property
|
||||
def is_authenticated(self) -> bool: ...
|
||||
def set_password(self, raw_password: str): ...
|
||||
|
||||
|
||||
class Group:
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
|
||||
class GroupManager:
|
||||
def get_by_natural_key(self, name: str) -> Group: ...
|
||||
|
||||
|
||||
class Permission:
|
||||
def __str__(self) -> str: ...
|
||||
def natural_key(self) -> Tuple[str, str, str]: ...
|
||||
|
||||
|
||||
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:
|
||||
def get_all_permissions(self, obj: None = ...) -> Set[str]: ...
|
||||
def has_module_perms(self, app_label: str) -> 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:
|
||||
def _create_user(
|
||||
self,
|
||||
username: str,
|
||||
email: Optional[str],
|
||||
password: Optional[str],
|
||||
**extra_fields
|
||||
self, username: str, email: Optional[str], password: Optional[str], **extra_fields
|
||||
) -> User: ...
|
||||
def create_superuser(
|
||||
self,
|
||||
username: str,
|
||||
email: str,
|
||||
password: Optional[str],
|
||||
**extra_fields
|
||||
self, username: str, email: str, password: Optional[str], **extra_fields
|
||||
) -> User: ...
|
||||
def create_user(
|
||||
self,
|
||||
username: str,
|
||||
email: Optional[str] = ...,
|
||||
password: Optional[str] = ...,
|
||||
**extra_fields
|
||||
) -> User: ...
|
||||
**extra_fields,
|
||||
) -> User: ...
|
||||
|
||||
@@ -8,10 +8,19 @@ from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.contrib.auth.models import User
|
||||
from pathlib import PosixPath
|
||||
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 validate_password(password: str, user: Optional[User] = ..., password_validators: None = ...) -> None: ...
|
||||
def password_changed(password: str, user: AbstractBaseUser = ..., password_validators: None = ...) -> None: ...
|
||||
|
||||
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 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_text_html(password_validators: None = ...) -> str: ...
|
||||
|
||||
@@ -27,7 +36,9 @@ class UserAttributeSimilarityValidator:
|
||||
DEFAULT_USER_ATTRIBUTES: Any = ...
|
||||
user_attributes: 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 get_help_text(self) -> str: ...
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ from typing import Any
|
||||
from datetime import date
|
||||
from django.contrib.auth.models import User
|
||||
from typing import Optional
|
||||
|
||||
class PasswordResetTokenGenerator:
|
||||
key_salt: str = ...
|
||||
secret: Any = ...
|
||||
|
||||
@@ -10,34 +10,17 @@ from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Optional,
|
||||
Set,
|
||||
Type,
|
||||
Union,
|
||||
)
|
||||
|
||||
from typing import Any, Dict, Optional, Set, Type, Union
|
||||
|
||||
def redirect_to_login(
|
||||
next: str,
|
||||
login_url: Optional[str] = ...,
|
||||
redirect_field_name: Optional[str] = ...
|
||||
next: str, login_url: Optional[str] = ..., redirect_field_name: Optional[str] = ...
|
||||
) -> HttpResponseRedirect: ...
|
||||
|
||||
|
||||
class LoginView:
|
||||
def dispatch(
|
||||
self,
|
||||
request: HttpRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
self, request: HttpRequest, *args, **kwargs
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
def form_valid(
|
||||
self,
|
||||
form: AuthenticationForm
|
||||
) -> HttpResponseRedirect: ...
|
||||
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
||||
def get_context_data(self, **kwargs) -> Dict[str, Any]: ...
|
||||
def get_form_class(self) -> Type[AuthenticationForm]: ...
|
||||
def get_form_kwargs(
|
||||
@@ -46,63 +29,36 @@ class LoginView:
|
||||
def get_redirect_url(self) -> str: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
|
||||
|
||||
class LogoutView:
|
||||
def dispatch(
|
||||
self,
|
||||
request: HttpRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
self, request: HttpRequest, *args, **kwargs
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
def get_next_page(self) -> Optional[str]: ...
|
||||
def post(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
def post(self, request: WSGIRequest, *args, **kwargs) -> TemplateResponse: ...
|
||||
|
||||
class PasswordChangeDoneView:
|
||||
def dispatch(self, *args, **kwargs) -> TemplateResponse: ...
|
||||
|
||||
|
||||
class PasswordChangeView:
|
||||
def dispatch(
|
||||
self,
|
||||
*args,
|
||||
**kwargs
|
||||
self, *args, **kwargs
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
def form_valid(
|
||||
self,
|
||||
form: PasswordChangeForm
|
||||
) -> HttpResponseRedirect: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[str, Optional[Union[MultiValueDict, User]]]: ...
|
||||
|
||||
def form_valid(self, form: PasswordChangeForm) -> HttpResponseRedirect: ...
|
||||
def get_form_kwargs(self) -> Dict[str, Optional[Union[MultiValueDict, User]]]: ...
|
||||
|
||||
class PasswordResetConfirmView:
|
||||
def dispatch(
|
||||
self,
|
||||
*args,
|
||||
**kwargs
|
||||
self, *args, **kwargs
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[str, Optional[Union[MultiValueDict, User]]]: ...
|
||||
def get_form_kwargs(self) -> Dict[str, Optional[Union[MultiValueDict, User]]]: ...
|
||||
def get_user(self, uidb64: str) -> Optional[User]: ...
|
||||
|
||||
|
||||
class PasswordResetView:
|
||||
def dispatch(
|
||||
self,
|
||||
*args,
|
||||
**kwargs
|
||||
self, *args, **kwargs
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
def form_valid(self, form: PasswordResetForm) -> HttpResponseRedirect: ...
|
||||
|
||||
|
||||
class SuccessURLAllowedHostsMixin:
|
||||
def get_success_url_allowed_hosts(self) -> Set[str]: ...
|
||||
def get_success_url_allowed_hosts(self) -> Set[str]: ...
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
from django.db.models.base import Model
|
||||
from typing import (
|
||||
Any,
|
||||
List,
|
||||
Type,
|
||||
)
|
||||
|
||||
from typing import Any, List, Type
|
||||
|
||||
class GenericInlineModelAdminChecks:
|
||||
def _check_exclude_of_parent_model(
|
||||
self,
|
||||
obj: GenericTabularInline,
|
||||
parent_model: Type[Model]
|
||||
self, obj: GenericTabularInline, parent_model: Type[Model]
|
||||
) -> List[Any]: ...
|
||||
def _check_relation(
|
||||
self,
|
||||
obj: GenericTabularInline,
|
||||
parent_model: Type[Model]
|
||||
) -> List[Any]: ...
|
||||
self, obj: GenericTabularInline, parent_model: Type[Model]
|
||||
) -> List[Any]: ...
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, List
|
||||
|
||||
def check_generic_foreign_keys(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
def check_model_name_lengths(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
|
||||
@@ -1,36 +1,20 @@
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.checks.messages import Error
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import (
|
||||
AutoField,
|
||||
PositiveIntegerField,
|
||||
)
|
||||
from django.db.models.fields import AutoField, PositiveIntegerField
|
||||
from django.db.models.fields.related import OneToOneField
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import (
|
||||
FilteredRelation,
|
||||
PathInfo,
|
||||
)
|
||||
from django.db.models.query_utils import FilteredRelation, PathInfo
|
||||
from django.db.models.sql.where import WhereNode
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
Type,
|
||||
Union,
|
||||
)
|
||||
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
class GenericForeignKey:
|
||||
def __get__(
|
||||
self,
|
||||
instance: Optional[Model],
|
||||
cls: Type[Model] = ...
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> 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 __str__(self) -> str: ...
|
||||
def _check_content_type_field(self) -> List[Error]: ...
|
||||
@@ -43,20 +27,16 @@ class GenericForeignKey:
|
||||
self,
|
||||
obj: Optional[Model] = ...,
|
||||
id: Optional[int] = ...,
|
||||
using: Optional[str] = ...
|
||||
using: Optional[str] = ...,
|
||||
) -> ContentType: ...
|
||||
def get_filter_kwargs_for_object(
|
||||
self,
|
||||
obj: Model
|
||||
self, obj: Model
|
||||
) -> Dict[str, Optional[Union[ContentType, int]]]: ...
|
||||
def get_forward_related_filter(self, obj: Model) -> Dict[str, int]: ...
|
||||
def get_prefetch_queryset(
|
||||
self,
|
||||
instances: Union[List[Model], QuerySet],
|
||||
queryset: Optional[QuerySet] = ...
|
||||
self, instances: Union[List[Model], QuerySet], queryset: Optional[QuerySet] = ...
|
||||
) -> Tuple[List[Model], Callable, Callable, bool, str, bool]: ...
|
||||
|
||||
|
||||
class GenericRel:
|
||||
def __init__(
|
||||
self,
|
||||
@@ -64,10 +44,9 @@ class GenericRel:
|
||||
to: Union[Type[Model], str],
|
||||
related_name: None = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: None = ...
|
||||
limit_choices_to: None = ...,
|
||||
) -> None: ...
|
||||
|
||||
|
||||
class GenericRelation:
|
||||
def __init__(
|
||||
self,
|
||||
@@ -77,35 +56,29 @@ class GenericRelation:
|
||||
for_concrete_model: bool = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: None = ...,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
) -> None: ...
|
||||
def _check_generic_foreign_key_existence(self) -> List[Any]: ...
|
||||
def _get_path_info_with_parent(self, filtered_relation: None) -> List[PathInfo]: ...
|
||||
def _is_matching_generic_foreign_key(
|
||||
self,
|
||||
field: Optional[Union[GenericForeignKey, GenericRelation]]
|
||||
self, field: Optional[Union[GenericForeignKey, GenericRelation]]
|
||||
) -> bool: ...
|
||||
def bulk_related_objects(
|
||||
self,
|
||||
objs: List[Model],
|
||||
using: str = ...
|
||||
) -> QuerySet: ...
|
||||
def bulk_related_objects(self, objs: List[Model], using: str = ...) -> QuerySet: ...
|
||||
def check(self, **kwargs) -> List[Error]: ...
|
||||
def contribute_to_class(self, cls: Type[Model], name: str, **kwargs) -> None: ...
|
||||
def get_content_type(self) -> ContentType: ...
|
||||
def get_extra_restriction(
|
||||
self,
|
||||
where_class: Type[WhereNode],
|
||||
alias: Optional[str],
|
||||
remote_alias: str
|
||||
self, where_class: Type[WhereNode], alias: Optional[str], remote_alias: str
|
||||
) -> WhereNode: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def get_path_info(
|
||||
self,
|
||||
filtered_relation: Optional[FilteredRelation] = ...
|
||||
self, filtered_relation: Optional[FilteredRelation] = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def get_reverse_path_info(self, filtered_relation: None = ...) -> List[PathInfo]: ...
|
||||
def resolve_related_fields(
|
||||
self
|
||||
) -> Union[List[Tuple[PositiveIntegerField, related.OneToOneField]], List[Tuple[PositiveIntegerField, AutoField]]]: ...
|
||||
def set_attributes_from_rel(self) -> None: ...
|
||||
) -> Union[
|
||||
List[Tuple[PositiveIntegerField, related.OneToOneField]],
|
||||
List[Tuple[PositiveIntegerField, AutoField]],
|
||||
]: ...
|
||||
def set_attributes_from_rel(self) -> None: ...
|
||||
|
||||
@@ -12,15 +12,40 @@ from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.migrations.migration import Migration
|
||||
from django.db.migrations.state import StateApps
|
||||
from typing import Any, List, Tuple, Type, Union
|
||||
|
||||
class RenameContentType(migrations.RunPython):
|
||||
app_label: Any = ...
|
||||
old_model: Any = ...
|
||||
new_model: Any = ...
|
||||
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_forward(self, apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: ...
|
||||
def rename_backward(self, apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: ...
|
||||
def _rename(
|
||||
self,
|
||||
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 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: ...
|
||||
def inject_rename_contenttypes_operations(
|
||||
plan: Union[List[Any], List[Tuple[Migration, bool]]] = ...,
|
||||
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: ...
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, **options) -> None: ...
|
||||
|
||||
|
||||
class NoFastDeleteCollector:
|
||||
def can_fast_delete(self, *args, **kwargs) -> bool: ...
|
||||
def can_fast_delete(self, *args, **kwargs) -> bool: ...
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.options import Options
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Tuple,
|
||||
Type,
|
||||
)
|
||||
|
||||
from typing import Any, Dict, Tuple, Type
|
||||
|
||||
class ContentType:
|
||||
def __str__(self) -> str: ...
|
||||
@@ -18,7 +12,6 @@ class ContentType:
|
||||
def name(self) -> str: ...
|
||||
def natural_key(self) -> Tuple[str, str]: ...
|
||||
|
||||
|
||||
class ContentTypeManager:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def _add_to_cache(self, using: str, ct: ContentType) -> None: ...
|
||||
@@ -27,13 +20,7 @@ class ContentTypeManager:
|
||||
def clear_cache(self) -> None: ...
|
||||
def get_by_natural_key(self, app_label: str, model: str) -> ContentType: ...
|
||||
def get_for_id(self, id: int) -> ContentType: ...
|
||||
def get_for_model(
|
||||
self,
|
||||
model: Any,
|
||||
for_concrete_model: bool = ...
|
||||
) -> ContentType: ...
|
||||
def get_for_model(self, model: Any, for_concrete_model: bool = ...) -> ContentType: ...
|
||||
def get_for_models(
|
||||
self,
|
||||
*models,
|
||||
for_concrete_models = ...
|
||||
) -> Dict[Type[Model], ContentType]: ...
|
||||
self, *models, for_concrete_models=...
|
||||
) -> Dict[Type[Model], ContentType]: ...
|
||||
|
||||
@@ -2,9 +2,6 @@ from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseRedirect
|
||||
from typing import Union
|
||||
|
||||
|
||||
def shortcut(
|
||||
request: HttpRequest,
|
||||
content_type_id: Union[str, int],
|
||||
object_id: Union[str, int]
|
||||
) -> HttpResponseRedirect: ...
|
||||
request: HttpRequest, content_type_id: Union[str, int], object_id: Union[str, int]
|
||||
) -> HttpResponseRedirect: ...
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
from django.contrib.sitemaps import Sitemap
|
||||
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
class FlatPageSitemap(Sitemap):
|
||||
def items(self) -> QuerySet: ...
|
||||
|
||||
@@ -6,6 +6,7 @@ from typing import Any, Optional
|
||||
|
||||
from datetime import date, datetime
|
||||
from typing import Optional, Union
|
||||
|
||||
register: Any
|
||||
|
||||
def ordinal(value: Optional[str]) -> Optional[str]: ...
|
||||
|
||||
@@ -8,14 +8,46 @@ from django.contrib.messages.storage.base import BaseStorage
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Optional, Union
|
||||
|
||||
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_level(request: HttpRequest) -> int: ...
|
||||
def set_level(request: HttpRequest, level: int) -> bool: ...
|
||||
def debug(request: WSGIRequest, message: str, extra_tags: str = ..., 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: ...
|
||||
def debug(
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
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: ...
|
||||
|
||||
@@ -7,4 +7,5 @@ from typing import Any
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Dict, Union
|
||||
|
||||
def messages(request: HttpRequest) -> Dict[str, Union[Dict[str, int], BaseStorage]]: ...
|
||||
|
||||
@@ -8,6 +8,9 @@ from typing import Any
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseBase
|
||||
|
||||
class MessageMiddleware(MiddlewareMixin):
|
||||
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: ...
|
||||
|
||||
@@ -6,4 +6,5 @@ from typing import Any
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
from django.http.request import HttpRequest
|
||||
|
||||
def default_storage(request: HttpRequest) -> BaseStorage: ...
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseBase
|
||||
from typing import (
|
||||
List,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
from typing import List, Optional, Union
|
||||
|
||||
class BaseStorage:
|
||||
def __init__(self, request: HttpRequest, *args, **kwargs) -> None: ...
|
||||
@@ -18,13 +13,14 @@ class BaseStorage:
|
||||
def add(self, level: int, message: str, extra_tags: Optional[str] = ...) -> None: ...
|
||||
def update(self, response: HttpResponseBase) -> None: ...
|
||||
|
||||
|
||||
class Message:
|
||||
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 _prepare(self) -> None: ...
|
||||
@property
|
||||
def level_tag(self) -> str: ...
|
||||
@property
|
||||
def tags(self) -> str: ...
|
||||
def tags(self) -> str: ...
|
||||
|
||||
@@ -9,22 +9,43 @@ from typing import Any
|
||||
from django.contrib.messages.storage.base import Message
|
||||
from django.http.response import HttpResponse
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
|
||||
class MessageEncoder(json.JSONEncoder):
|
||||
message_key: str = ...
|
||||
def default(self, obj: Message) -> List[Union[int, str]]: ...
|
||||
|
||||
class MessageDecoder(json.JSONDecoder):
|
||||
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):
|
||||
cookie_name: str = ...
|
||||
max_cookie_size: int = ...
|
||||
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 _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 _get(
|
||||
self, *args: Any, **kwargs: Any
|
||||
) -> 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 _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 = ...
|
||||
def _decode(self, data: Optional[str]) -> Any: ...
|
||||
|
||||
@@ -8,10 +8,17 @@ from typing import Any
|
||||
from django.contrib.messages.storage.base import Message
|
||||
from django.http.response import HttpResponse
|
||||
from typing import Any, List, Tuple, Union
|
||||
|
||||
class FallbackStorage(BaseStorage):
|
||||
storage_classes: Any = ...
|
||||
storages: Any = ...
|
||||
_used_storages: Any = ...
|
||||
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 _store(self, messages: List[Message], response: HttpResponse, *args: Any, **kwargs: Any) -> List[Any]: ...
|
||||
def _get(
|
||||
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]: ...
|
||||
|
||||
@@ -9,10 +9,17 @@ from django.contrib.messages.storage.base import Message
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponse
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
|
||||
class SessionStorage(BaseStorage):
|
||||
session_key: str = ...
|
||||
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 _store(self, messages: List[Message], response: HttpResponse, *args: Any, **kwargs: Any) -> List[Any]: ...
|
||||
def _get(
|
||||
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 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]]]: ...
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Dict
|
||||
|
||||
def get_level_tags() -> Dict[int, str]: ...
|
||||
|
||||
@@ -7,6 +7,7 @@ from typing import Any, Optional
|
||||
from datetime import datetime, timedelta
|
||||
from django.db.models.base import Model
|
||||
from typing import Dict, Optional, Union
|
||||
|
||||
VALID_KEY_CHARS: Any
|
||||
|
||||
class CreateError(Exception): ...
|
||||
@@ -25,7 +26,9 @@ class SessionBase:
|
||||
def __getitem__(self, key: str) -> Union[str, Model, int]: ...
|
||||
def __setitem__(self, key: str, value: Union[str, datetime, int]) -> 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 setdefault(self, key: str, value: str) -> str: ...
|
||||
def set_test_cookie(self) -> None: ...
|
||||
@@ -49,7 +52,9 @@ class SessionBase:
|
||||
__session_key: Any = ...
|
||||
def _set_session_key(self, value: Optional[str]) -> None: ...
|
||||
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 = ...
|
||||
def get_expiry_age(self, **kwargs: Any) -> int: ...
|
||||
def get_expiry_date(self, **kwargs: Any) -> datetime: ...
|
||||
|
||||
@@ -6,6 +6,7 @@ from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
KEY_PREFIX: str
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
|
||||
@@ -6,6 +6,7 @@ from django.contrib.sessions.backends.db import SessionStore as DBStore
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
KEY_PREFIX: str
|
||||
|
||||
class SessionStore(DBStore):
|
||||
|
||||
@@ -9,6 +9,7 @@ from datetime import datetime
|
||||
from django.contrib.sessions.base_session import AbstractBaseSession
|
||||
from django.contrib.sessions.models import Session
|
||||
from typing import Dict, Optional, Type, Union
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@classmethod
|
||||
@@ -20,7 +21,9 @@ class SessionStore(SessionBase):
|
||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||
modified: bool = ...
|
||||
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 delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@classmethod
|
||||
|
||||
@@ -6,6 +6,7 @@ from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Dict, Optional
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
storage_path: Any = ...
|
||||
file_prefix: Any = ...
|
||||
|
||||
@@ -7,6 +7,7 @@ from typing import Any, Optional
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Dict, Optional, Union
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
def load(self) -> Dict[str, Union[str, datetime]]: ...
|
||||
modified: bool = ...
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from typing import Dict
|
||||
|
||||
|
||||
class AbstractBaseSession:
|
||||
def __str__(self) -> str: ...
|
||||
def get_decoded(self) -> Dict[str, int]: ...
|
||||
def get_decoded(self) -> Dict[str, int]: ...
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
class Command:
|
||||
def handle(self, **options) -> None: ...
|
||||
def handle(self, **options) -> None: ...
|
||||
|
||||
@@ -8,9 +8,12 @@ from typing import Any, Optional
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponseBase
|
||||
from typing import Callable, Optional
|
||||
|
||||
class SessionMiddleware(MiddlewareMixin):
|
||||
get_response: Any = ...
|
||||
SessionStore: Any = ...
|
||||
def __init__(self, get_response: Optional[Callable] = ...) -> 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: ...
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from django.contrib.sessions.backends.db import SessionStore
|
||||
from typing import Type
|
||||
|
||||
|
||||
class Session:
|
||||
@classmethod
|
||||
def get_session_store_class(cls) -> Type[SessionStore]: ...
|
||||
def get_session_store_class(cls) -> Type[SessionStore]: ...
|
||||
|
||||
@@ -8,7 +8,9 @@ from typing import Any
|
||||
from datetime import datetime
|
||||
from django.db.models.base import Model
|
||||
from typing import Dict, Union
|
||||
|
||||
class PickleSerializer:
|
||||
def dumps(self, obj: Dict[str, Union[str, datetime]]) -> bytes: ...
|
||||
def loads(self, data: bytes) -> Dict[str, Model]: ...
|
||||
|
||||
JSONSerializer = BaseJSONSerializer
|
||||
|
||||
@@ -11,6 +11,7 @@ from django.core.paginator import Paginator
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
PING_URL: str
|
||||
|
||||
class SitemapNotFound(Exception): ...
|
||||
@@ -26,9 +27,18 @@ class Sitemap:
|
||||
def location(self, obj: Model) -> str: ...
|
||||
@property
|
||||
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 = ...
|
||||
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):
|
||||
priority: Any = ...
|
||||
@@ -36,7 +46,13 @@ class GenericSitemap(Sitemap):
|
||||
queryset: Any = ...
|
||||
date_field: 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 lastmod(self, item: Model) -> None: ...
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
class Command:
|
||||
def handle(self, *args, **options) -> None: ...
|
||||
def handle(self, *args, **options) -> None: ...
|
||||
|
||||
@@ -9,6 +9,19 @@ from django.contrib.sitemaps import GenericSitemap, Sitemap
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.template.response import TemplateResponse
|
||||
from typing import Callable, Dict, Optional, Type, Union
|
||||
|
||||
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 sitemap(request: WSGIRequest, sitemaps: Dict[str, Union[Type[Sitemap], Type[FlatPageSitemap], GenericSitemap]], section: Optional[str] = ..., template_name: str = ..., content_type: str = ...) -> TemplateResponse: ...
|
||||
def index(
|
||||
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: ...
|
||||
|
||||
@@ -6,4 +6,12 @@ from typing import Any
|
||||
|
||||
from django.apps.registry import Apps
|
||||
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: ...
|
||||
|
||||
@@ -8,6 +8,7 @@ from typing import Any, Optional
|
||||
from django.core.checks.messages import Error
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import List
|
||||
|
||||
class CurrentSiteManager(models.Manager):
|
||||
use_in_migrations: bool = ...
|
||||
__field_name: Any = ...
|
||||
|
||||
@@ -7,5 +7,6 @@ from django.utils.deprecation import MiddlewareMixin
|
||||
from typing import Any
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
|
||||
class CurrentSiteMiddleware(MiddlewareMixin):
|
||||
def process_request(self, request: HttpRequest) -> None: ...
|
||||
|
||||
@@ -1,26 +1,15 @@
|
||||
from django.http.request import HttpRequest
|
||||
from typing import (
|
||||
Optional,
|
||||
Type,
|
||||
)
|
||||
|
||||
from typing import Optional, Type
|
||||
|
||||
def _simple_domain_name_validator(value: str): ...
|
||||
|
||||
|
||||
def clear_site_cache(sender: Type[Site], **kwargs) -> None: ...
|
||||
|
||||
|
||||
class Site:
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
|
||||
class SiteManager:
|
||||
def _get_site_by_id(self, site_id: int) -> Site: ...
|
||||
def _get_site_by_request(self, request: HttpRequest) -> Site: ...
|
||||
def clear_cache(self) -> None: ...
|
||||
def get_by_natural_key(self, domain: str) -> Site: ...
|
||||
def get_current(
|
||||
self,
|
||||
request: Optional[HttpRequest] = ...
|
||||
) -> Site: ...
|
||||
def get_current(self, request: Optional[HttpRequest] = ...) -> Site: ...
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
from typing import Any
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
|
||||
class RequestSite:
|
||||
domain: Any = ...
|
||||
def __init__(self, request: HttpRequest) -> None: ...
|
||||
|
||||
@@ -8,4 +8,5 @@ from django.contrib.sites.models import Site
|
||||
from django.contrib.sites.requests import RequestSite
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Optional, Union
|
||||
|
||||
def get_current_site(request: Optional[HttpRequest]) -> Union[RequestSite, Site]: ...
|
||||
|
||||
@@ -5,4 +5,5 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, List
|
||||
|
||||
def check_finders(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
|
||||
@@ -8,6 +8,7 @@ from django.contrib.staticfiles.storage import StaticFilesStorage
|
||||
from django.core.checks.messages import Error
|
||||
from django.core.files.storage import DefaultStorage, FileSystemStorage
|
||||
from typing import Iterator, List, Optional, Tuple, Union
|
||||
|
||||
searched_locations: Any
|
||||
|
||||
class BaseFinder:
|
||||
@@ -22,7 +23,9 @@ class FileSystemFinder(BaseFinder):
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
def find(self, path: str, all: bool = ...) -> Union[str, List[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):
|
||||
storage_class: Any = ...
|
||||
@@ -30,13 +33,17 @@ class AppDirectoriesFinder(BaseFinder):
|
||||
apps: Any = ...
|
||||
storages: Any = ...
|
||||
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_in_app(self, app: str, path: str) -> Optional[str]: ...
|
||||
|
||||
class BaseStorageFinder(BaseFinder):
|
||||
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 list(self, ignore_patterns: List[str]) -> Iterator[Tuple[str, DefaultStorage]]: ...
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ from django.core.handlers.wsgi import WSGIHandler
|
||||
from typing import Any
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
|
||||
class StaticFilesHandler(WSGIHandler):
|
||||
handles_files: bool = ...
|
||||
application: Any = ...
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
from django.core.files.storage import (
|
||||
DefaultStorage,
|
||||
FileSystemStorage,
|
||||
)
|
||||
from django.core.files.storage import DefaultStorage, FileSystemStorage
|
||||
from django.core.management.base import CommandParser
|
||||
from typing import (
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
from typing import Dict, List, Optional, Union
|
||||
|
||||
class Command:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
@@ -20,13 +11,13 @@ class Command:
|
||||
self,
|
||||
path: str,
|
||||
prefixed_path: str,
|
||||
source_storage: Union[FileSystemStorage, DefaultStorage]
|
||||
source_storage: Union[FileSystemStorage, DefaultStorage],
|
||||
) -> None: ...
|
||||
def delete_file(
|
||||
self,
|
||||
path: str,
|
||||
prefixed_path: str,
|
||||
source_storage: Union[FileSystemStorage, DefaultStorage]
|
||||
source_storage: Union[FileSystemStorage, DefaultStorage],
|
||||
) -> bool: ...
|
||||
def handle(self, **options) -> Optional[str]: ...
|
||||
def is_local_storage(self) -> bool: ...
|
||||
@@ -34,9 +25,9 @@ class Command:
|
||||
self,
|
||||
path: str,
|
||||
prefixed_path: str,
|
||||
source_storage: Union[FileSystemStorage, DefaultStorage]
|
||||
source_storage: Union[FileSystemStorage, DefaultStorage],
|
||||
) -> None: ...
|
||||
@cached_property
|
||||
def local(self) -> bool: ...
|
||||
def log(self, msg: str, level: int = ...) -> None: ...
|
||||
def set_options(self, **options) -> None: ...
|
||||
def set_options(self, **options) -> None: ...
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle_label(self, path: str, **options) -> str: ...
|
||||
def handle_label(self, path: str, **options) -> str: ...
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from django.contrib.staticfiles.handlers import StaticFilesHandler
|
||||
|
||||
|
||||
class Command:
|
||||
def get_handler(self, *args, **options) -> StaticFilesHandler: ...
|
||||
def get_handler(self, *args, **options) -> StaticFilesHandler: ...
|
||||
|
||||
@@ -11,10 +11,13 @@ from django.core.cache import DefaultCacheProxy
|
||||
from django.core.files.base import File
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
class StaticFilesStorage(FileSystemStorage):
|
||||
base_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: ...
|
||||
|
||||
class HashedFilesMixin:
|
||||
@@ -25,12 +28,29 @@ class HashedFilesMixin:
|
||||
hashed_files: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def file_hash(self, name: str, content: File = ...) -> str: ...
|
||||
def hashed_name(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 hashed_name(
|
||||
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_converter(self, name: str, hashed_files: OrderedDict, template: str = ...) -> 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 url_converter(
|
||||
self, name: str, hashed_files: OrderedDict, template: str = ...
|
||||
) -> 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 hash_key(self, name: str) -> str: ...
|
||||
def _stored_name(self, name: str, hashed_files: OrderedDict) -> str: ...
|
||||
|
||||
@@ -6,6 +6,7 @@ from typing import Any
|
||||
|
||||
from django.template.base import Parser, Token
|
||||
from django.templatetags.static import StaticNode
|
||||
|
||||
register: Any
|
||||
|
||||
def static(path: Any): ...
|
||||
|
||||
@@ -6,6 +6,7 @@ from typing import Any, Optional
|
||||
|
||||
from django.urls.resolvers import URLPattern
|
||||
from typing import List
|
||||
|
||||
urlpatterns: Any
|
||||
|
||||
def staticfiles_urlpatterns(prefix: None = ...) -> List[URLPattern]: ...
|
||||
|
||||
@@ -7,6 +7,13 @@ from typing import Any, Optional
|
||||
from collections import OrderedDict
|
||||
from django.core.files.storage import DefaultStorage, FileSystemStorage
|
||||
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: ...
|
||||
|
||||
@@ -6,4 +6,7 @@ from typing import Any
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
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: ...
|
||||
|
||||
@@ -11,6 +11,7 @@ from django.http.response import HttpResponse
|
||||
from django.utils.feedgenerator import Atom1Feed, Enclosure, Rss201rev2Feed
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
def add_domain(domain: str, url: str, secure: bool = ...) -> str: ...
|
||||
|
||||
class FeedDoesNotExist(ObjectDoesNotExist): ...
|
||||
@@ -24,9 +25,13 @@ class Feed:
|
||||
def item_description(self, item: Model) -> str: ...
|
||||
def item_link(self, item: Model) -> str: ...
|
||||
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 item_extra_kwargs(self, item: Model) -> Dict[Any, Any]: ...
|
||||
def get_object(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> None: ...
|
||||
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]: ...
|
||||
|
||||
13
django-stubs/core/cache/__init__.pyi
vendored
13
django-stubs/core/cache/__init__.pyi
vendored
@@ -1,23 +1,14 @@
|
||||
from collections import OrderedDict
|
||||
from django.core.cache.backends.base import BaseCache
|
||||
from typing import (
|
||||
Callable,
|
||||
Dict,
|
||||
Union,
|
||||
)
|
||||
|
||||
from typing import Callable, Dict, Union
|
||||
|
||||
def _create_cache(backend: str, **kwargs) -> BaseCache: ...
|
||||
|
||||
|
||||
def close_caches(**kwargs) -> None: ...
|
||||
|
||||
|
||||
class CacheHandler:
|
||||
def __getitem__(self, alias: str) -> BaseCache: ...
|
||||
|
||||
|
||||
class DefaultCacheProxy:
|
||||
def __contains__(self, key: str) -> bool: ...
|
||||
def __getattr__(self, name: str) -> Union[OrderedDict, Dict[str, float], Callable]: ...
|
||||
def __setattr__(self, name: str, value: Callable) -> None: ...
|
||||
def __setattr__(self, name: str, value: Callable) -> None: ...
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user