mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 13:35:01 +08:00
run black over stubs, add checking to travis
This commit is contained in:
@@ -12,6 +12,10 @@ jobs:
|
|||||||
script: |
|
script: |
|
||||||
set -e
|
set -e
|
||||||
pytest
|
pytest
|
||||||
|
- name: "Lint with black"
|
||||||
|
python: 3.7
|
||||||
|
script: |
|
||||||
|
black --check --line-length=130 django-stubs/ django-stubs-generated/
|
||||||
|
|
||||||
before_install: |
|
before_install: |
|
||||||
# Upgrade pip, setuptools, and wheel
|
# Upgrade pip, setuptools, and wheel
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
|
black
|
||||||
-e git+https://github.com/mkurnikov/pytest-mypy-plugins.git#egg=pytest-mypy-plugins
|
-e git+https://github.com/mkurnikov/pytest-mypy-plugins.git#egg=pytest-mypy-plugins
|
||||||
-e .
|
-e .
|
||||||
|
|||||||
@@ -16,11 +16,7 @@ class AppConfig:
|
|||||||
def __init__(self, app_name: str, app_module: None) -> None: ...
|
def __init__(self, app_name: str, app_module: None) -> None: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(cls, entry: str) -> AppConfig: ...
|
def create(cls, entry: str) -> AppConfig: ...
|
||||||
def get_model(
|
def get_model(self, model_name: str, require_ready: bool = ...) -> Type[Model]: ...
|
||||||
self, model_name: str, require_ready: bool = ...
|
def get_models(self, include_auto_created: bool = ..., include_swapped: bool = ...) -> Iterator[Type[Model]]: ...
|
||||||
) -> Type[Model]: ...
|
|
||||||
def get_models(
|
|
||||||
self, include_auto_created: bool = ..., include_swapped: bool = ...
|
|
||||||
) -> Iterator[Type[Model]]: ...
|
|
||||||
def import_models(self) -> None: ...
|
def import_models(self) -> None: ...
|
||||||
def ready(self) -> None: ...
|
def ready(self) -> None: ...
|
||||||
|
|||||||
@@ -7,56 +7,33 @@ from django.db.models.base import Model
|
|||||||
|
|
||||||
from .config import AppConfig
|
from .config import AppConfig
|
||||||
|
|
||||||
|
|
||||||
class Apps:
|
class Apps:
|
||||||
all_models: collections.defaultdict = ...
|
all_models: collections.defaultdict = ...
|
||||||
app_configs: collections.OrderedDict = ...
|
app_configs: collections.OrderedDict = ...
|
||||||
stored_app_configs: List[Any] = ...
|
stored_app_configs: List[Any] = ...
|
||||||
apps_ready: bool = ...
|
apps_ready: bool = ...
|
||||||
loading: bool = ...
|
loading: bool = ...
|
||||||
def __init__(
|
def __init__(self, installed_apps: Optional[Union[List[AppConfigStub], List[str], Tuple]] = ...) -> None: ...
|
||||||
self,
|
|
||||||
installed_apps: Optional[
|
|
||||||
Union[List[AppConfigStub], List[str], Tuple]
|
|
||||||
] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
models_ready: bool = ...
|
models_ready: bool = ...
|
||||||
ready: bool = ...
|
ready: bool = ...
|
||||||
def populate(
|
def populate(self, installed_apps: Union[List[AppConfigStub], List[str], Tuple] = ...) -> None: ...
|
||||||
self, installed_apps: Union[List[AppConfigStub], List[str], Tuple] = ...
|
|
||||||
) -> None: ...
|
|
||||||
def check_apps_ready(self) -> None: ...
|
def check_apps_ready(self) -> None: ...
|
||||||
def check_models_ready(self) -> None: ...
|
def check_models_ready(self) -> None: ...
|
||||||
def get_app_configs(self): ...
|
def get_app_configs(self): ...
|
||||||
def get_app_config(self, app_label: str) -> AppConfig: ...
|
def get_app_config(self, app_label: str) -> AppConfig: ...
|
||||||
def get_models(
|
def get_models(self, include_auto_created: bool = ..., include_swapped: bool = ...) -> List[Type[Model]]: ...
|
||||||
self, include_auto_created: bool = ..., include_swapped: bool = ...
|
def get_model(self, app_label: str, model_name: Optional[str] = ..., require_ready: bool = ...) -> Type[Model]: ...
|
||||||
) -> List[Type[Model]]: ...
|
|
||||||
def get_model(
|
|
||||||
self,
|
|
||||||
app_label: str,
|
|
||||||
model_name: Optional[str] = ...,
|
|
||||||
require_ready: bool = ...,
|
|
||||||
) -> Type[Model]: ...
|
|
||||||
def register_model(self, app_label: str, model: Type[Model]) -> None: ...
|
def register_model(self, app_label: str, model: Type[Model]) -> None: ...
|
||||||
def is_installed(self, app_name: str) -> bool: ...
|
def is_installed(self, app_name: str) -> bool: ...
|
||||||
def get_containing_app_config(
|
def get_containing_app_config(self, object_name: str) -> Optional[AppConfig]: ...
|
||||||
self, object_name: str
|
def get_registered_model(self, app_label: str, model_name: str) -> Type[Model]: ...
|
||||||
) -> Optional[AppConfig]: ...
|
|
||||||
def get_registered_model(
|
|
||||||
self, app_label: str, model_name: str
|
|
||||||
) -> Type[Model]: ...
|
|
||||||
def get_swappable_settings_name(self, to_string: str) -> Optional[str]: ...
|
def get_swappable_settings_name(self, to_string: str) -> Optional[str]: ...
|
||||||
def set_available_apps(self, available: List[str]) -> None: ...
|
def set_available_apps(self, available: List[str]) -> None: ...
|
||||||
def unset_available_apps(self) -> None: ...
|
def unset_available_apps(self) -> None: ...
|
||||||
def set_installed_apps(
|
def set_installed_apps(self, installed: Union[List[str], Tuple[str]]) -> None: ...
|
||||||
self, installed: Union[List[str], Tuple[str]]
|
|
||||||
) -> None: ...
|
|
||||||
def unset_installed_apps(self) -> None: ...
|
def unset_installed_apps(self) -> None: ...
|
||||||
def clear_cache(self) -> None: ...
|
def clear_cache(self) -> None: ...
|
||||||
def lazy_model_operation(
|
def lazy_model_operation(self, function: Callable, *model_keys: Any) -> None: ...
|
||||||
self, function: Callable, *model_keys: Any
|
|
||||||
) -> None: ...
|
|
||||||
def do_pending_operations(self, model: Type[Model]) -> None: ...
|
def do_pending_operations(self, model: Type[Model]) -> None: ...
|
||||||
|
|
||||||
apps: Any
|
apps: Any
|
||||||
|
|||||||
@@ -24,9 +24,7 @@ class Settings:
|
|||||||
class UserSettingsHolder:
|
class UserSettingsHolder:
|
||||||
SETTINGS_MODULE: Any = ...
|
SETTINGS_MODULE: Any = ...
|
||||||
default_settings: django.conf.Settings = ...
|
default_settings: django.conf.Settings = ...
|
||||||
def __init__(
|
def __init__(self, default_settings: Union[Settings, UserSettingsHolder]) -> None: ...
|
||||||
self, default_settings: Union[Settings, UserSettingsHolder]
|
|
||||||
) -> None: ...
|
|
||||||
def __getattr__(self, name: str) -> Any: ...
|
def __getattr__(self, name: str) -> Any: ...
|
||||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||||
def __delattr__(self, name: str) -> None: ...
|
def __delattr__(self, name: str) -> None: ...
|
||||||
|
|||||||
@@ -21,12 +21,7 @@ def url(
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
kwargs: Optional[
|
kwargs: Optional[
|
||||||
Union[
|
Union[Dict[str, Dict[str, Type[FlatPageSitemap]]], Dict[str, Dict[str, Sitemap]], Dict[str, OrderedDict], Dict[str, str]]
|
||||||
Dict[str, Dict[str, Type[FlatPageSitemap]]],
|
|
||||||
Dict[str, Dict[str, Sitemap]],
|
|
||||||
Dict[str, OrderedDict],
|
|
||||||
Dict[str, str],
|
|
||||||
]
|
|
||||||
] = ...,
|
] = ...,
|
||||||
name: Optional[str] = ...,
|
name: Optional[str] = ...,
|
||||||
) -> Union[URLPattern, URLResolver]: ...
|
) -> Union[URLPattern, URLResolver]: ...
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from typing import Any, List, Tuple, Union
|
|||||||
|
|
||||||
from django.urls.resolvers import URLPattern, URLResolver
|
from django.urls.resolvers import URLPattern, URLResolver
|
||||||
|
|
||||||
|
|
||||||
def i18n_patterns(
|
def i18n_patterns(
|
||||||
*urls: Any, prefix_default_language: bool = ...
|
*urls: Any, prefix_default_language: bool = ...
|
||||||
) -> Union[List[List[Any]], List[URLPattern], List[URLResolver]]: ...
|
) -> Union[List[List[Any]], List[URLPattern], List[URLResolver]]: ...
|
||||||
|
|||||||
@@ -2,7 +2,4 @@ from typing import Any, Callable, List
|
|||||||
|
|
||||||
from django.urls.resolvers import URLPattern
|
from django.urls.resolvers import URLPattern
|
||||||
|
|
||||||
|
def static(prefix: str, view: Callable = ..., **kwargs: Any) -> List[URLPattern]: ...
|
||||||
def static(
|
|
||||||
prefix: str, view: Callable = ..., **kwargs: Any
|
|
||||||
) -> List[URLPattern]: ...
|
|
||||||
|
|||||||
@@ -1,23 +1,16 @@
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from django.contrib.admin.decorators import register as register
|
from django.contrib.admin.decorators import register as register
|
||||||
from django.contrib.admin.filters import \
|
from django.contrib.admin.filters import AllValuesFieldListFilter as AllValuesFieldListFilter
|
||||||
AllValuesFieldListFilter as AllValuesFieldListFilter
|
from django.contrib.admin.filters import BooleanFieldListFilter as BooleanFieldListFilter
|
||||||
from django.contrib.admin.filters import \
|
from django.contrib.admin.filters import ChoicesFieldListFilter as ChoicesFieldListFilter
|
||||||
BooleanFieldListFilter as BooleanFieldListFilter
|
from django.contrib.admin.filters import DateFieldListFilter as DateFieldListFilter
|
||||||
from django.contrib.admin.filters import \
|
|
||||||
ChoicesFieldListFilter as ChoicesFieldListFilter
|
|
||||||
from django.contrib.admin.filters import \
|
|
||||||
DateFieldListFilter as DateFieldListFilter
|
|
||||||
from django.contrib.admin.filters import FieldListFilter as FieldListFilter
|
from django.contrib.admin.filters import FieldListFilter as FieldListFilter
|
||||||
from django.contrib.admin.filters import ListFilter as ListFilter
|
from django.contrib.admin.filters import ListFilter as ListFilter
|
||||||
from django.contrib.admin.filters import \
|
from django.contrib.admin.filters import RelatedFieldListFilter as RelatedFieldListFilter
|
||||||
RelatedFieldListFilter as RelatedFieldListFilter
|
from django.contrib.admin.filters import RelatedOnlyFieldListFilter as RelatedOnlyFieldListFilter
|
||||||
from django.contrib.admin.filters import \
|
|
||||||
RelatedOnlyFieldListFilter as RelatedOnlyFieldListFilter
|
|
||||||
from django.contrib.admin.filters import SimpleListFilter as SimpleListFilter
|
from django.contrib.admin.filters import SimpleListFilter as SimpleListFilter
|
||||||
from django.contrib.admin.helpers import \
|
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME as ACTION_CHECKBOX_NAME
|
||||||
ACTION_CHECKBOX_NAME as ACTION_CHECKBOX_NAME
|
|
||||||
from django.contrib.admin.options import HORIZONTAL as HORIZONTAL
|
from django.contrib.admin.options import HORIZONTAL as HORIZONTAL
|
||||||
from django.contrib.admin.options import VERTICAL as VERTICAL
|
from django.contrib.admin.options import VERTICAL as VERTICAL
|
||||||
from django.contrib.admin.options import ModelAdmin as ModelAdmin
|
from django.contrib.admin.options import ModelAdmin as ModelAdmin
|
||||||
@@ -26,5 +19,4 @@ from django.contrib.admin.options import TabularInline as TabularInline
|
|||||||
from django.contrib.admin.sites import AdminSite as AdminSite
|
from django.contrib.admin.sites import AdminSite as AdminSite
|
||||||
from django.contrib.admin.sites import site as site
|
from django.contrib.admin.sites import site as site
|
||||||
|
|
||||||
|
|
||||||
def autodiscover() -> None: ...
|
def autodiscover() -> None: ...
|
||||||
|
|||||||
@@ -5,7 +5,4 @@ from django.core.handlers.wsgi import WSGIRequest
|
|||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
|
|
||||||
|
def delete_selected(modeladmin: ModelAdmin, request: WSGIRequest, queryset: QuerySet) -> Optional[TemplateResponse]: ...
|
||||||
def delete_selected(
|
|
||||||
modeladmin: ModelAdmin, request: WSGIRequest, queryset: QuerySet
|
|
||||||
) -> Optional[TemplateResponse]: ...
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
class SimpleAdminConfig(AppConfig):
|
class SimpleAdminConfig(AppConfig):
|
||||||
apps: None
|
apps: None
|
||||||
label: str
|
label: str
|
||||||
|
|||||||
@@ -1,28 +1,20 @@
|
|||||||
from typing import Any, List, Optional
|
from typing import Any, List, Optional
|
||||||
|
|
||||||
from django.contrib.admin.options import (BaseModelAdmin, InlineModelAdmin,
|
from django.contrib.admin.options import BaseModelAdmin, InlineModelAdmin, ModelAdmin
|
||||||
ModelAdmin)
|
|
||||||
from django.core.checks.messages import Error
|
from django.core.checks.messages import Error
|
||||||
|
|
||||||
|
|
||||||
def check_admin_app(app_configs: None, **kwargs: Any) -> List[str]: ...
|
def check_admin_app(app_configs: None, **kwargs: Any) -> List[str]: ...
|
||||||
def check_dependencies(**kwargs: Any) -> List[Error]: ...
|
def check_dependencies(**kwargs: Any) -> List[Error]: ...
|
||||||
|
|
||||||
class BaseModelAdminChecks:
|
class BaseModelAdminChecks:
|
||||||
def check(
|
def check(self, admin_obj: BaseModelAdmin, **kwargs: Any) -> List[Error]: ...
|
||||||
self, admin_obj: BaseModelAdmin, **kwargs: Any
|
|
||||||
) -> List[Error]: ...
|
|
||||||
|
|
||||||
class ModelAdminChecks(BaseModelAdminChecks):
|
class ModelAdminChecks(BaseModelAdminChecks):
|
||||||
def check(self, admin_obj: ModelAdmin, **kwargs: Any) -> List[Error]: ...
|
def check(self, admin_obj: ModelAdmin, **kwargs: Any) -> List[Error]: ...
|
||||||
|
|
||||||
class InlineModelAdminChecks(BaseModelAdminChecks):
|
class InlineModelAdminChecks(BaseModelAdminChecks):
|
||||||
def check(
|
def check(self, inline_obj: InlineModelAdmin, **kwargs: Any) -> List[Any]: ...
|
||||||
self, inline_obj: InlineModelAdmin, **kwargs: Any
|
|
||||||
) -> List[Any]: ...
|
|
||||||
|
|
||||||
def must_be(type: Any, option: Any, obj: Any, id: Any): ...
|
def must_be(type: Any, option: Any, obj: Any, id: Any): ...
|
||||||
def must_inherit_from(parent: Any, option: Any, obj: Any, id: Any): ...
|
def must_inherit_from(parent: Any, option: Any, obj: Any, id: Any): ...
|
||||||
def refer_to_missing_field(
|
def refer_to_missing_field(field: Any, option: Any, model: Any, obj: Any, id: Any): ...
|
||||||
field: Any, option: Any, model: Any, obj: Any, id: Any
|
|
||||||
): ...
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
from typing import Any, Callable, Optional
|
from typing import Any, Callable, Optional
|
||||||
|
|
||||||
|
|
||||||
def register(*models: Any, site: Optional[Any] = ...) -> Callable: ...
|
def register(*models: Any, site: Optional[Any] = ...) -> Callable: ...
|
||||||
|
|||||||
@@ -9,18 +9,11 @@ from django.db.models.fields.related import RelatedField
|
|||||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
|
|
||||||
class ListFilter:
|
class ListFilter:
|
||||||
title: Any = ...
|
title: Any = ...
|
||||||
template: str = ...
|
template: str = ...
|
||||||
used_parameters: Any = ...
|
used_parameters: Any = ...
|
||||||
def __init__(
|
def __init__(self, request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin) -> None: ...
|
||||||
self,
|
|
||||||
request: WSGIRequest,
|
|
||||||
params: Dict[str, str],
|
|
||||||
model: Type[Model],
|
|
||||||
model_admin: ModelAdmin,
|
|
||||||
) -> None: ...
|
|
||||||
def has_output(self) -> None: ...
|
def has_output(self) -> None: ...
|
||||||
def choices(self, changelist: Any) -> None: ...
|
def choices(self, changelist: Any) -> None: ...
|
||||||
def queryset(self, request: Any, queryset: Any) -> None: ...
|
def queryset(self, request: Any, queryset: Any) -> None: ...
|
||||||
@@ -29,13 +22,7 @@ class ListFilter:
|
|||||||
class SimpleListFilter(ListFilter):
|
class SimpleListFilter(ListFilter):
|
||||||
parameter_name: Any = ...
|
parameter_name: Any = ...
|
||||||
lookup_choices: Any = ...
|
lookup_choices: Any = ...
|
||||||
def __init__(
|
def __init__(self, request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin) -> None: ...
|
||||||
self,
|
|
||||||
request: WSGIRequest,
|
|
||||||
params: Dict[str, str],
|
|
||||||
model: Type[Model],
|
|
||||||
model_admin: ModelAdmin,
|
|
||||||
) -> None: ...
|
|
||||||
def has_output(self) -> bool: ...
|
def has_output(self) -> bool: ...
|
||||||
def value(self) -> Optional[str]: ...
|
def value(self) -> Optional[str]: ...
|
||||||
def lookups(self, request: Any, model_admin: Any) -> None: ...
|
def lookups(self, request: Any, model_admin: Any) -> None: ...
|
||||||
@@ -56,16 +43,9 @@ class FieldListFilter(ListFilter):
|
|||||||
field_path: str,
|
field_path: str,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def has_output(self) -> bool: ...
|
def has_output(self) -> bool: ...
|
||||||
def queryset(
|
def queryset(self, request: WSGIRequest, queryset: QuerySet) -> QuerySet: ...
|
||||||
self, request: WSGIRequest, queryset: QuerySet
|
|
||||||
) -> QuerySet: ...
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def register(
|
def register(cls, test: Callable, list_filter_class: Type[FieldListFilter], take_priority: bool = ...) -> None: ...
|
||||||
cls,
|
|
||||||
test: Callable,
|
|
||||||
list_filter_class: Type[FieldListFilter],
|
|
||||||
take_priority: bool = ...,
|
|
||||||
) -> None: ...
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(
|
def create(
|
||||||
cls,
|
cls,
|
||||||
@@ -103,10 +83,7 @@ class RelatedFieldListFilter(FieldListFilter):
|
|||||||
def has_output(self) -> bool: ...
|
def has_output(self) -> bool: ...
|
||||||
def expected_parameters(self) -> List[str]: ...
|
def expected_parameters(self) -> List[str]: ...
|
||||||
def field_choices(
|
def field_choices(
|
||||||
self,
|
self, field: FieldCacheMixin, request: WSGIRequest, model_admin: ModelAdmin
|
||||||
field: FieldCacheMixin,
|
|
||||||
request: WSGIRequest,
|
|
||||||
model_admin: ModelAdmin,
|
|
||||||
) -> List[Tuple[Union[int, str], str]]: ...
|
) -> List[Tuple[Union[int, str], str]]: ...
|
||||||
def choices(self, changelist: Any) -> None: ...
|
def choices(self, changelist: Any) -> None: ...
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from typing import Any, Optional
|
|||||||
from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm
|
from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
|
||||||
class AdminAuthenticationForm(AuthenticationForm):
|
class AdminAuthenticationForm(AuthenticationForm):
|
||||||
auto_id: str
|
auto_id: str
|
||||||
data: Dict[str, str]
|
data: Dict[str, str]
|
||||||
|
|||||||
@@ -70,13 +70,7 @@ class Fieldline:
|
|||||||
has_visible_field: Any = ...
|
has_visible_field: Any = ...
|
||||||
model_admin: Any = ...
|
model_admin: Any = ...
|
||||||
readonly_fields: Any = ...
|
readonly_fields: Any = ...
|
||||||
def __init__(
|
def __init__(self, form: Any, field: Any, readonly_fields: Optional[Any] = ..., model_admin: Optional[Any] = ...) -> None: ...
|
||||||
self,
|
|
||||||
form: Any,
|
|
||||||
field: Any,
|
|
||||||
readonly_fields: Optional[Any] = ...,
|
|
||||||
model_admin: Optional[Any] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def __iter__(self) -> Iterator[Union[AdminField, AdminReadonlyField]]: ...
|
def __iter__(self) -> Iterator[Union[AdminField, AdminReadonlyField]]: ...
|
||||||
def errors(self) -> SafeText: ...
|
def errors(self) -> SafeText: ...
|
||||||
|
|
||||||
@@ -97,13 +91,7 @@ class AdminReadonlyField:
|
|||||||
is_checkbox: bool = ...
|
is_checkbox: bool = ...
|
||||||
is_readonly: bool = ...
|
is_readonly: bool = ...
|
||||||
empty_value_display: Any = ...
|
empty_value_display: Any = ...
|
||||||
def __init__(
|
def __init__(self, form: Any, field: Any, is_first: Any, model_admin: Optional[Any] = ...) -> None: ...
|
||||||
self,
|
|
||||||
form: Any,
|
|
||||||
field: Any,
|
|
||||||
is_first: Any,
|
|
||||||
model_admin: Optional[Any] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def label_tag(self) -> SafeText: ...
|
def label_tag(self) -> SafeText: ...
|
||||||
def contents(self) -> SafeText: ...
|
def contents(self) -> SafeText: ...
|
||||||
|
|
||||||
@@ -133,9 +121,7 @@ class InlineAdminFormSet:
|
|||||||
has_view_permission: bool = ...,
|
has_view_permission: bool = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __iter__(self) -> Iterator[InlineAdminForm]: ...
|
def __iter__(self) -> Iterator[InlineAdminForm]: ...
|
||||||
def fields(
|
def fields(self) -> Iterator[Dict[str, Union[Dict[str, bool], bool, Widget, str]]]: ...
|
||||||
self
|
|
||||||
) -> Iterator[Dict[str, Union[Dict[str, bool], bool, Widget, str]]]: ...
|
|
||||||
def inline_formset_data(self) -> str: ...
|
def inline_formset_data(self) -> str: ...
|
||||||
@property
|
@property
|
||||||
def forms(self): ...
|
def forms(self): ...
|
||||||
|
|||||||
@@ -21,11 +21,7 @@ class LogEntryManager(models.Manager):
|
|||||||
object_id: Union[int, str, UUID],
|
object_id: Union[int, str, UUID],
|
||||||
object_repr: str,
|
object_repr: str,
|
||||||
action_flag: int,
|
action_flag: int,
|
||||||
change_message: Union[
|
change_message: Union[Dict[str, Dict[str, List[str]]], List[Dict[str, Dict[str, Union[List[str], str]]]], str] = ...,
|
||||||
Dict[str, Dict[str, List[str]]],
|
|
||||||
List[Dict[str, Dict[str, Union[List[str], str]]]],
|
|
||||||
str,
|
|
||||||
] = ...,
|
|
||||||
) -> LogEntry: ...
|
) -> LogEntry: ...
|
||||||
|
|
||||||
class LogEntry(models.Model):
|
class LogEntry(models.Model):
|
||||||
|
|||||||
@@ -12,14 +12,12 @@ from django.core.handlers.wsgi import WSGIRequest
|
|||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import Field
|
||||||
from django.db.models.fields.related import (ForeignKey, ManyToManyField,
|
from django.db.models.fields.related import ForeignKey, ManyToManyField, RelatedField
|
||||||
RelatedField)
|
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from django.forms.fields import Field, TypedChoiceField
|
from django.forms.fields import Field, TypedChoiceField
|
||||||
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
|
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
|
||||||
from django.forms.widgets import Media
|
from django.forms.widgets import Media
|
||||||
from django.http.response import (HttpResponse, HttpResponseBase,
|
from django.http.response import HttpResponse, HttpResponseBase, HttpResponseRedirect, JsonResponse
|
||||||
HttpResponseRedirect, JsonResponse)
|
|
||||||
from django.urls.resolvers import URLPattern
|
from django.urls.resolvers import URLPattern
|
||||||
from django.utils.safestring import SafeText
|
from django.utils.safestring import SafeText
|
||||||
|
|
||||||
@@ -28,9 +26,7 @@ TO_FIELD_VAR: str
|
|||||||
HORIZONTAL: Any
|
HORIZONTAL: Any
|
||||||
VERTICAL: Any
|
VERTICAL: Any
|
||||||
|
|
||||||
def get_content_type_for_model(
|
def get_content_type_for_model(obj: Union[Type[Model], Model]) -> ContentType: ...
|
||||||
obj: Union[Type[Model], Model]
|
|
||||||
) -> ContentType: ...
|
|
||||||
def get_ul_class(radio_style: int) -> str: ...
|
def get_ul_class(radio_style: int) -> str: ...
|
||||||
|
|
||||||
class IncorrectLookupParameters(Exception): ...
|
class IncorrectLookupParameters(Exception): ...
|
||||||
@@ -58,15 +54,9 @@ class BaseModelAdmin:
|
|||||||
checks_class: Any = ...
|
checks_class: Any = ...
|
||||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||||
def __init__(self) -> None: ...
|
def __init__(self) -> None: ...
|
||||||
def formfield_for_dbfield(
|
def formfield_for_dbfield(self, db_field: Field, request: WSGIRequest, **kwargs: Any) -> Optional[Field]: ...
|
||||||
self, db_field: Field, request: WSGIRequest, **kwargs: Any
|
def formfield_for_choice_field(self, db_field: Field, request: WSGIRequest, **kwargs: Any) -> TypedChoiceField: ...
|
||||||
) -> Optional[Field]: ...
|
def get_field_queryset(self, db: None, db_field: RelatedField, request: WSGIRequest) -> Optional[QuerySet]: ...
|
||||||
def formfield_for_choice_field(
|
|
||||||
self, db_field: Field, request: WSGIRequest, **kwargs: Any
|
|
||||||
) -> TypedChoiceField: ...
|
|
||||||
def get_field_queryset(
|
|
||||||
self, db: None, db_field: RelatedField, request: WSGIRequest
|
|
||||||
) -> Optional[QuerySet]: ...
|
|
||||||
def formfield_for_foreignkey(
|
def formfield_for_foreignkey(
|
||||||
self, db_field: ForeignKey, request: WSGIRequest, **kwargs: Any
|
self, db_field: ForeignKey, request: WSGIRequest, **kwargs: Any
|
||||||
) -> Optional[ModelChoiceField]: ...
|
) -> Optional[ModelChoiceField]: ...
|
||||||
@@ -74,13 +64,9 @@ class BaseModelAdmin:
|
|||||||
self, db_field: ManyToManyField, request: WSGIRequest, **kwargs: Any
|
self, db_field: ManyToManyField, request: WSGIRequest, **kwargs: Any
|
||||||
) -> ModelMultipleChoiceField: ...
|
) -> ModelMultipleChoiceField: ...
|
||||||
def get_autocomplete_fields(self, request: WSGIRequest) -> Tuple: ...
|
def get_autocomplete_fields(self, request: WSGIRequest) -> Tuple: ...
|
||||||
def get_view_on_site_url(
|
def get_view_on_site_url(self, obj: Optional[Model] = ...) -> Optional[str]: ...
|
||||||
self, obj: Optional[Model] = ...
|
|
||||||
) -> Optional[str]: ...
|
|
||||||
def get_empty_value_display(self) -> SafeText: ...
|
def get_empty_value_display(self) -> SafeText: ...
|
||||||
def get_exclude(
|
def get_exclude(self, request: WSGIRequest, obj: Optional[Model] = ...) -> None: ...
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
|
||||||
) -> None: ...
|
|
||||||
def get_fields(
|
def get_fields(
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||||
) -> Union[List[Union[Callable, str]], Tuple[str, str]]: ...
|
) -> Union[List[Union[Callable, str]], Tuple[str, str]]: ...
|
||||||
@@ -88,52 +74,25 @@ class BaseModelAdmin:
|
|||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||||
) -> Union[
|
) -> Union[
|
||||||
List[Tuple[None, Dict[str, List[Union[Callable, str]]]]],
|
List[Tuple[None, Dict[str, List[Union[Callable, str]]]]],
|
||||||
Tuple[
|
Tuple[Tuple[Optional[str], Dict[str, Tuple[Union[Tuple[str, str], str]]]]],
|
||||||
Tuple[Optional[str], Dict[str, Tuple[Union[Tuple[str, str], str]]]]
|
|
||||||
],
|
|
||||||
]: ...
|
]: ...
|
||||||
def get_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
def get_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
||||||
def get_readonly_fields(
|
def get_readonly_fields(self, request: WSGIRequest, obj: Optional[Model] = ...) -> Union[List[str], Tuple]: ...
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
def get_prepopulated_fields(self, request: WSGIRequest, obj: Optional[Model] = ...) -> Dict[str, Tuple[str]]: ...
|
||||||
) -> Union[List[str], Tuple]: ...
|
|
||||||
def get_prepopulated_fields(
|
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
|
||||||
) -> Dict[str, Tuple[str]]: ...
|
|
||||||
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
||||||
def get_sortable_by(
|
def get_sortable_by(self, request: WSGIRequest) -> Union[List[Callable], List[str], Tuple]: ...
|
||||||
self, request: WSGIRequest
|
|
||||||
) -> Union[List[Callable], List[str], Tuple]: ...
|
|
||||||
def lookup_allowed(self, lookup: str, value: str) -> bool: ...
|
def lookup_allowed(self, lookup: str, value: str) -> bool: ...
|
||||||
def to_field_allowed(self, request: WSGIRequest, to_field: str) -> bool: ...
|
def to_field_allowed(self, request: WSGIRequest, to_field: str) -> bool: ...
|
||||||
def has_add_permission(self, request: WSGIRequest) -> bool: ...
|
def has_add_permission(self, request: WSGIRequest) -> bool: ...
|
||||||
def has_change_permission(
|
def has_change_permission(self, request: WSGIRequest, obj: Optional[Model] = ...) -> bool: ...
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
def has_delete_permission(self, request: WSGIRequest, obj: Optional[Model] = ...) -> bool: ...
|
||||||
) -> bool: ...
|
def has_view_permission(self, request: WSGIRequest, obj: Optional[Model] = ...) -> bool: ...
|
||||||
def has_delete_permission(
|
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
|
||||||
) -> bool: ...
|
|
||||||
def has_view_permission(
|
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
|
||||||
) -> bool: ...
|
|
||||||
def has_module_permission(self, request: WSGIRequest) -> bool: ...
|
def has_module_permission(self, request: WSGIRequest) -> bool: ...
|
||||||
|
|
||||||
class ModelAdmin(BaseModelAdmin):
|
class ModelAdmin(BaseModelAdmin):
|
||||||
formfield_overrides: Dict[
|
formfield_overrides: Dict[
|
||||||
Type[
|
Type[Union[django.db.models.fields.DateTimeCheckMixin, django.db.models.fields.Field]],
|
||||||
Union[
|
Dict[str, Type[Union[django.forms.fields.SplitDateTimeField, django.forms.widgets.Widget]]],
|
||||||
django.db.models.fields.DateTimeCheckMixin,
|
|
||||||
django.db.models.fields.Field,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Type[
|
|
||||||
Union[
|
|
||||||
django.forms.fields.SplitDateTimeField,
|
|
||||||
django.forms.widgets.Widget,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
list_display: Any = ...
|
list_display: Any = ...
|
||||||
list_display_links: Any = ...
|
list_display_links: Any = ...
|
||||||
@@ -166,161 +125,73 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
model: Type[django.db.models.base.Model] = ...
|
model: Type[django.db.models.base.Model] = ...
|
||||||
opts: django.db.models.options.Options = ...
|
opts: django.db.models.options.Options = ...
|
||||||
admin_site: django.contrib.admin.sites.AdminSite = ...
|
admin_site: django.contrib.admin.sites.AdminSite = ...
|
||||||
def __init__(
|
def __init__(self, model: Type[Model], admin_site: Optional[AdminSite]) -> None: ...
|
||||||
self, model: Type[Model], admin_site: Optional[AdminSite]
|
def get_inline_instances(self, request: WSGIRequest, obj: Optional[Model] = ...) -> List[InlineModelAdmin]: ...
|
||||||
) -> None: ...
|
|
||||||
def get_inline_instances(
|
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
|
||||||
) -> List[InlineModelAdmin]: ...
|
|
||||||
def get_urls(self) -> List[URLPattern]: ...
|
def get_urls(self) -> List[URLPattern]: ...
|
||||||
@property
|
@property
|
||||||
def urls(self) -> List[URLPattern]: ...
|
def urls(self) -> List[URLPattern]: ...
|
||||||
@property
|
@property
|
||||||
def media(self) -> Media: ...
|
def media(self) -> Media: ...
|
||||||
def get_model_perms(self, request: WSGIRequest) -> Dict[str, bool]: ...
|
def get_model_perms(self, request: WSGIRequest) -> Dict[str, bool]: ...
|
||||||
def get_form(
|
def get_form(self, request: Any, obj: Optional[Any] = ..., change: bool = ..., **kwargs: Any): ...
|
||||||
self,
|
def get_changelist(self, request: WSGIRequest, **kwargs: Any) -> Type[ChangeList]: ...
|
||||||
request: Any,
|
|
||||||
obj: Optional[Any] = ...,
|
|
||||||
change: bool = ...,
|
|
||||||
**kwargs: Any
|
|
||||||
): ...
|
|
||||||
def get_changelist(
|
|
||||||
self, request: WSGIRequest, **kwargs: Any
|
|
||||||
) -> Type[ChangeList]: ...
|
|
||||||
def get_changelist_instance(self, request: WSGIRequest) -> ChangeList: ...
|
def get_changelist_instance(self, request: WSGIRequest) -> ChangeList: ...
|
||||||
def get_object(
|
def get_object(self, request: WSGIRequest, object_id: str, from_field: None = ...) -> Optional[Model]: ...
|
||||||
self, request: WSGIRequest, object_id: str, from_field: None = ...
|
|
||||||
) -> Optional[Model]: ...
|
|
||||||
def get_changelist_form(self, request: Any, **kwargs: Any): ...
|
def get_changelist_form(self, request: Any, **kwargs: Any): ...
|
||||||
def get_changelist_formset(self, request: Any, **kwargs: Any): ...
|
def get_changelist_formset(self, request: Any, **kwargs: Any): ...
|
||||||
def get_formsets_with_inlines(
|
def get_formsets_with_inlines(self, request: WSGIRequest, obj: Optional[Model] = ...) -> None: ...
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
|
||||||
) -> None: ...
|
|
||||||
def get_paginator(
|
def get_paginator(
|
||||||
self,
|
self, request: WSGIRequest, queryset: QuerySet, per_page: int, orphans: int = ..., allow_empty_first_page: bool = ...
|
||||||
request: WSGIRequest,
|
|
||||||
queryset: QuerySet,
|
|
||||||
per_page: int,
|
|
||||||
orphans: int = ...,
|
|
||||||
allow_empty_first_page: bool = ...,
|
|
||||||
) -> Paginator: ...
|
) -> Paginator: ...
|
||||||
def log_addition(
|
def log_addition(
|
||||||
self,
|
self, request: WSGIRequest, object: Model, message: Union[Dict[str, Dict[Any, Any]], List[Dict[str, Dict[str, str]]]]
|
||||||
request: WSGIRequest,
|
|
||||||
object: Model,
|
|
||||||
message: Union[
|
|
||||||
Dict[str, Dict[Any, Any]], List[Dict[str, Dict[str, str]]]
|
|
||||||
],
|
|
||||||
) -> LogEntry: ...
|
) -> LogEntry: ...
|
||||||
def log_change(
|
def log_change(
|
||||||
self,
|
self,
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
object: Model,
|
object: Model,
|
||||||
message: Union[
|
message: Union[Dict[str, Dict[str, List[str]]], List[Dict[str, Dict[str, Union[List[str], str]]]]],
|
||||||
Dict[str, Dict[str, List[str]]],
|
|
||||||
List[Dict[str, Dict[str, Union[List[str], str]]]],
|
|
||||||
],
|
|
||||||
) -> LogEntry: ...
|
|
||||||
def log_deletion(
|
|
||||||
self, request: WSGIRequest, object: Model, object_repr: str
|
|
||||||
) -> LogEntry: ...
|
) -> LogEntry: ...
|
||||||
|
def log_deletion(self, request: WSGIRequest, object: Model, object_repr: str) -> LogEntry: ...
|
||||||
def action_checkbox(self, obj: Model) -> SafeText: ...
|
def action_checkbox(self, obj: Model) -> SafeText: ...
|
||||||
def get_actions(self, request: WSGIRequest) -> OrderedDict: ...
|
def get_actions(self, request: WSGIRequest) -> OrderedDict: ...
|
||||||
def get_action_choices(
|
def get_action_choices(self, request: WSGIRequest, default_choices: List[Tuple[str, str]] = ...) -> List[Tuple[str, str]]: ...
|
||||||
self, request: WSGIRequest, default_choices: List[Tuple[str, str]] = ...
|
def get_action(self, action: Union[Callable, str]) -> Tuple[Callable, str, str]: ...
|
||||||
) -> List[Tuple[str, str]]: ...
|
def get_list_display(self, request: WSGIRequest) -> Union[List[Callable], List[str], Tuple[str]]: ...
|
||||||
def get_action(
|
|
||||||
self, action: Union[Callable, str]
|
|
||||||
) -> Tuple[Callable, str, str]: ...
|
|
||||||
def get_list_display(
|
|
||||||
self, request: WSGIRequest
|
|
||||||
) -> Union[List[Callable], List[str], Tuple[str]]: ...
|
|
||||||
def get_list_display_links(
|
def get_list_display_links(
|
||||||
self,
|
self, request: WSGIRequest, list_display: Union[List[Callable], List[str], Tuple[str]]
|
||||||
request: WSGIRequest,
|
|
||||||
list_display: Union[List[Callable], List[str], Tuple[str]],
|
|
||||||
) -> Optional[Union[List[Callable], List[str], Tuple[str]]]: ...
|
) -> Optional[Union[List[Callable], List[str], Tuple[str]]]: ...
|
||||||
def get_list_filter(
|
def get_list_filter(self, request: WSGIRequest) -> Union[List[Type[SimpleListFilter]], List[str], Tuple]: ...
|
||||||
self, request: WSGIRequest
|
def get_list_select_related(self, request: WSGIRequest) -> Union[Tuple, bool]: ...
|
||||||
) -> Union[List[Type[SimpleListFilter]], List[str], Tuple]: ...
|
def get_search_fields(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
||||||
def get_list_select_related(
|
def get_search_results(self, request: WSGIRequest, queryset: QuerySet, search_term: str) -> Tuple[QuerySet, bool]: ...
|
||||||
self, request: WSGIRequest
|
|
||||||
) -> Union[Tuple, bool]: ...
|
|
||||||
def get_search_fields(
|
|
||||||
self, request: WSGIRequest
|
|
||||||
) -> Union[List[str], Tuple]: ...
|
|
||||||
def get_search_results(
|
|
||||||
self, request: WSGIRequest, queryset: QuerySet, search_term: str
|
|
||||||
) -> Tuple[QuerySet, bool]: ...
|
|
||||||
def get_preserved_filters(self, request: WSGIRequest) -> str: ...
|
def get_preserved_filters(self, request: WSGIRequest) -> str: ...
|
||||||
def construct_change_message(
|
def construct_change_message(
|
||||||
self,
|
self, request: WSGIRequest, form: AdminPasswordChangeForm, formsets: None, add: bool = ...
|
||||||
request: WSGIRequest,
|
|
||||||
form: AdminPasswordChangeForm,
|
|
||||||
formsets: None,
|
|
||||||
add: bool = ...,
|
|
||||||
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||||
def message_user(
|
def message_user(
|
||||||
self,
|
self, request: WSGIRequest, message: str, level: Union[int, str] = ..., extra_tags: str = ..., fail_silently: bool = ...
|
||||||
request: WSGIRequest,
|
|
||||||
message: str,
|
|
||||||
level: Union[int, str] = ...,
|
|
||||||
extra_tags: str = ...,
|
|
||||||
fail_silently: bool = ...,
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def save_form(self, request: Any, form: Any, change: Any): ...
|
def save_form(self, request: Any, form: Any, change: Any): ...
|
||||||
def save_model(
|
def save_model(self, request: Any, obj: Any, form: Any, change: Any) -> None: ...
|
||||||
self, request: Any, obj: Any, form: Any, change: Any
|
|
||||||
) -> None: ...
|
|
||||||
def delete_model(self, request: WSGIRequest, obj: Model) -> None: ...
|
def delete_model(self, request: WSGIRequest, obj: Model) -> None: ...
|
||||||
def delete_queryset(
|
def delete_queryset(self, request: WSGIRequest, queryset: QuerySet) -> None: ...
|
||||||
self, request: WSGIRequest, queryset: QuerySet
|
def save_formset(self, request: Any, form: Any, formset: Any, change: Any) -> None: ...
|
||||||
) -> None: ...
|
def save_related(self, request: Any, form: Any, formsets: Any, change: Any) -> None: ...
|
||||||
def save_formset(
|
|
||||||
self, request: Any, form: Any, formset: Any, change: Any
|
|
||||||
) -> None: ...
|
|
||||||
def save_related(
|
|
||||||
self, request: Any, form: Any, formsets: Any, change: Any
|
|
||||||
) -> None: ...
|
|
||||||
def render_change_form(
|
def render_change_form(
|
||||||
self,
|
self, request: Any, context: Any, add: bool = ..., change: bool = ..., form_url: str = ..., obj: Optional[Any] = ...
|
||||||
request: Any,
|
|
||||||
context: Any,
|
|
||||||
add: bool = ...,
|
|
||||||
change: bool = ...,
|
|
||||||
form_url: str = ...,
|
|
||||||
obj: Optional[Any] = ...,
|
|
||||||
): ...
|
): ...
|
||||||
def response_add(
|
def response_add(self, request: WSGIRequest, obj: Model, post_url_continue: None = ...) -> HttpResponse: ...
|
||||||
self, request: WSGIRequest, obj: Model, post_url_continue: None = ...
|
def response_change(self, request: WSGIRequest, obj: Model) -> HttpResponse: ...
|
||||||
) -> HttpResponse: ...
|
def response_post_save_add(self, request: WSGIRequest, obj: Model) -> HttpResponseRedirect: ...
|
||||||
def response_change(
|
def response_post_save_change(self, request: WSGIRequest, obj: Model) -> HttpResponseRedirect: ...
|
||||||
self, request: WSGIRequest, obj: Model
|
def response_action(self, request: WSGIRequest, queryset: QuerySet) -> Optional[HttpResponseBase]: ...
|
||||||
) -> HttpResponse: ...
|
def response_delete(self, request: WSGIRequest, obj_display: str, obj_id: int) -> HttpResponse: ...
|
||||||
def response_post_save_add(
|
|
||||||
self, request: WSGIRequest, obj: Model
|
|
||||||
) -> HttpResponseRedirect: ...
|
|
||||||
def response_post_save_change(
|
|
||||||
self, request: WSGIRequest, obj: Model
|
|
||||||
) -> HttpResponseRedirect: ...
|
|
||||||
def response_action(
|
|
||||||
self, request: WSGIRequest, queryset: QuerySet
|
|
||||||
) -> Optional[HttpResponseBase]: ...
|
|
||||||
def response_delete(
|
|
||||||
self, request: WSGIRequest, obj_display: str, obj_id: int
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
def render_delete_form(self, request: Any, context: Any): ...
|
def render_delete_form(self, request: Any, context: Any): ...
|
||||||
def get_inline_formsets(
|
def get_inline_formsets(
|
||||||
self,
|
self, request: WSGIRequest, formsets: List[Any], inline_instances: List[Any], obj: Optional[Model] = ...
|
||||||
request: WSGIRequest,
|
|
||||||
formsets: List[Any],
|
|
||||||
inline_instances: List[Any],
|
|
||||||
obj: Optional[Model] = ...,
|
|
||||||
) -> List[Any]: ...
|
) -> List[Any]: ...
|
||||||
def get_changeform_initial_data(
|
def get_changeform_initial_data(self, request: WSGIRequest) -> Dict[str, str]: ...
|
||||||
self, request: WSGIRequest
|
|
||||||
) -> Dict[str, str]: ...
|
|
||||||
def changeform_view(
|
def changeform_view(
|
||||||
self,
|
self,
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
@@ -329,33 +200,16 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
extra_context: Optional[Dict[str, bool]] = ...,
|
extra_context: Optional[Dict[str, bool]] = ...,
|
||||||
) -> Any: ...
|
) -> Any: ...
|
||||||
def autocomplete_view(self, request: WSGIRequest) -> JsonResponse: ...
|
def autocomplete_view(self, request: WSGIRequest) -> JsonResponse: ...
|
||||||
def add_view(
|
def add_view(self, request: WSGIRequest, form_url: str = ..., extra_context: None = ...) -> HttpResponse: ...
|
||||||
self,
|
|
||||||
request: WSGIRequest,
|
|
||||||
form_url: str = ...,
|
|
||||||
extra_context: None = ...,
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
def change_view(
|
def change_view(
|
||||||
self,
|
self, request: WSGIRequest, object_id: str, form_url: str = ..., extra_context: Optional[Dict[str, bool]] = ...
|
||||||
request: WSGIRequest,
|
|
||||||
object_id: str,
|
|
||||||
form_url: str = ...,
|
|
||||||
extra_context: Optional[Dict[str, bool]] = ...,
|
|
||||||
) -> HttpResponse: ...
|
) -> HttpResponse: ...
|
||||||
def changelist_view(
|
def changelist_view(self, request: WSGIRequest, extra_context: Optional[Dict[str, str]] = ...) -> HttpResponseBase: ...
|
||||||
self,
|
|
||||||
request: WSGIRequest,
|
|
||||||
extra_context: Optional[Dict[str, str]] = ...,
|
|
||||||
) -> HttpResponseBase: ...
|
|
||||||
def get_deleted_objects(
|
def get_deleted_objects(
|
||||||
self, objs: QuerySet, request: WSGIRequest
|
self, objs: QuerySet, request: WSGIRequest
|
||||||
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
||||||
def delete_view(
|
def delete_view(self, request: WSGIRequest, object_id: str, extra_context: None = ...) -> Any: ...
|
||||||
self, request: WSGIRequest, object_id: str, extra_context: None = ...
|
def history_view(self, request: WSGIRequest, object_id: str, extra_context: None = ...) -> HttpResponse: ...
|
||||||
) -> Any: ...
|
|
||||||
def history_view(
|
|
||||||
self, request: WSGIRequest, object_id: str, extra_context: None = ...
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
|
|
||||||
class InlineModelAdmin(BaseModelAdmin):
|
class InlineModelAdmin(BaseModelAdmin):
|
||||||
model: Any = ...
|
model: Any = ...
|
||||||
@@ -375,37 +229,19 @@ class InlineModelAdmin(BaseModelAdmin):
|
|||||||
parent_model: Any = ...
|
parent_model: Any = ...
|
||||||
opts: Any = ...
|
opts: Any = ...
|
||||||
has_registered_model: Any = ...
|
has_registered_model: Any = ...
|
||||||
def __init__(
|
def __init__(self, parent_model: Union[Type[Model], Model], admin_site: AdminSite) -> None: ...
|
||||||
self, parent_model: Union[Type[Model], Model], admin_site: AdminSite
|
|
||||||
) -> None: ...
|
|
||||||
@property
|
@property
|
||||||
def media(self) -> Media: ...
|
def media(self) -> Media: ...
|
||||||
def get_extra(
|
def get_extra(self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any) -> int: ...
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any
|
def get_min_num(self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any) -> None: ...
|
||||||
) -> int: ...
|
def get_max_num(self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any) -> Optional[int]: ...
|
||||||
def get_min_num(
|
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
def get_max_num(
|
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any
|
|
||||||
) -> Optional[int]: ...
|
|
||||||
fields: Any = ...
|
fields: Any = ...
|
||||||
def get_formset(
|
def get_formset(self, request: Any, obj: Optional[Any] = ..., **kwargs: Any): ...
|
||||||
self, request: Any, obj: Optional[Any] = ..., **kwargs: Any
|
|
||||||
): ...
|
|
||||||
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
||||||
def has_add_permission(
|
def has_add_permission(self, request: WSGIRequest, obj: Optional[Model]) -> bool: ...
|
||||||
self, request: WSGIRequest, obj: Optional[Model]
|
def has_change_permission(self, request: WSGIRequest, obj: Optional[Model] = ...) -> bool: ...
|
||||||
) -> bool: ...
|
def has_delete_permission(self, request: WSGIRequest, obj: Optional[Model] = ...) -> bool: ...
|
||||||
def has_change_permission(
|
def has_view_permission(self, request: WSGIRequest, obj: Optional[Model] = ...) -> bool: ...
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
|
||||||
) -> bool: ...
|
|
||||||
def has_delete_permission(
|
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
|
||||||
) -> bool: ...
|
|
||||||
def has_view_permission(
|
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
|
||||||
) -> bool: ...
|
|
||||||
|
|
||||||
class StackedInline(InlineModelAdmin):
|
class StackedInline(InlineModelAdmin):
|
||||||
template: str = ...
|
template: str = ...
|
||||||
|
|||||||
@@ -30,9 +30,7 @@ class AdminSite:
|
|||||||
def check(self, app_configs: None) -> List[str]: ...
|
def check(self, app_configs: None) -> List[str]: ...
|
||||||
def register(
|
def register(
|
||||||
self,
|
self,
|
||||||
model_or_iterable: Union[
|
model_or_iterable: Union[List[Type[Model]], Tuple[Type[Model]], Type[Model]],
|
||||||
List[Type[Model]], Tuple[Type[Model]], Type[Model]
|
|
||||||
],
|
|
||||||
admin_class: Optional[Type[ModelAdmin]] = ...,
|
admin_class: Optional[Type[ModelAdmin]] = ...,
|
||||||
**options: Any
|
**options: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@@ -53,32 +51,14 @@ class AdminSite:
|
|||||||
@property
|
@property
|
||||||
def urls(self) -> Tuple[List[Union[URLPattern, URLResolver]], str, str]: ...
|
def urls(self) -> Tuple[List[Union[URLPattern, URLResolver]], str, str]: ...
|
||||||
def each_context(self, request: Any): ...
|
def each_context(self, request: Any): ...
|
||||||
def password_change(
|
def password_change(self, request: WSGIRequest, extra_context: Dict[str, str] = ...) -> TemplateResponse: ...
|
||||||
self, request: WSGIRequest, extra_context: Dict[str, str] = ...
|
def password_change_done(self, request: WSGIRequest, extra_context: None = ...) -> TemplateResponse: ...
|
||||||
) -> TemplateResponse: ...
|
def i18n_javascript(self, request: WSGIRequest, extra_context: Optional[Dict[Any, Any]] = ...) -> HttpResponse: ...
|
||||||
def password_change_done(
|
def logout(self, request: WSGIRequest, extra_context: None = ...) -> TemplateResponse: ...
|
||||||
self, request: WSGIRequest, extra_context: None = ...
|
def login(self, request: WSGIRequest, extra_context: None = ...) -> HttpResponse: ...
|
||||||
) -> TemplateResponse: ...
|
|
||||||
def i18n_javascript(
|
|
||||||
self,
|
|
||||||
request: WSGIRequest,
|
|
||||||
extra_context: Optional[Dict[Any, Any]] = ...,
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
def logout(
|
|
||||||
self, request: WSGIRequest, extra_context: None = ...
|
|
||||||
) -> TemplateResponse: ...
|
|
||||||
def login(
|
|
||||||
self, request: WSGIRequest, extra_context: None = ...
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
def get_app_list(self, request: WSGIRequest) -> List[Any]: ...
|
def get_app_list(self, request: WSGIRequest) -> List[Any]: ...
|
||||||
def index(
|
def index(self, request: WSGIRequest, extra_context: Optional[Dict[str, str]] = ...) -> TemplateResponse: ...
|
||||||
self,
|
def app_index(self, request: WSGIRequest, app_label: str, extra_context: None = ...) -> TemplateResponse: ...
|
||||||
request: WSGIRequest,
|
|
||||||
extra_context: Optional[Dict[str, str]] = ...,
|
|
||||||
) -> TemplateResponse: ...
|
|
||||||
def app_index(
|
|
||||||
self, request: WSGIRequest, app_label: str, extra_context: None = ...
|
|
||||||
) -> TemplateResponse: ...
|
|
||||||
|
|
||||||
class DefaultAdminSite(LazyObject): ...
|
class DefaultAdminSite(LazyObject): ...
|
||||||
|
|
||||||
|
|||||||
@@ -15,16 +15,10 @@ register: Any
|
|||||||
DOT: str
|
DOT: str
|
||||||
|
|
||||||
def paginator_number(cl: ChangeList, i: int) -> SafeText: ...
|
def paginator_number(cl: ChangeList, i: int) -> SafeText: ...
|
||||||
def pagination(
|
def pagination(cl: ChangeList) -> Dict[str, Union[List[Union[int, str]], ChangeList, int, range, str]]: ...
|
||||||
cl: ChangeList
|
|
||||||
) -> Dict[str, Union[List[Union[int, str]], ChangeList, int, range, str]]: ...
|
|
||||||
def pagination_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
def pagination_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
def result_headers(
|
def result_headers(cl: ChangeList) -> Iterator[Dict[str, Optional[Union[int, str]]]]: ...
|
||||||
cl: ChangeList
|
def items_for_result(cl: ChangeList, result: Model, form: None) -> Iterator[SafeText]: ...
|
||||||
) -> Iterator[Dict[str, Optional[Union[int, str]]]]: ...
|
|
||||||
def items_for_result(
|
|
||||||
cl: ChangeList, result: Model, form: None
|
|
||||||
) -> Iterator[SafeText]: ...
|
|
||||||
|
|
||||||
class ResultList(list):
|
class ResultList(list):
|
||||||
form: None = ...
|
form: None = ...
|
||||||
@@ -34,26 +28,13 @@ def results(cl: ChangeList) -> Iterator[ResultList]: ...
|
|||||||
def result_hidden_fields(cl: ChangeList) -> Iterator[BoundField]: ...
|
def result_hidden_fields(cl: ChangeList) -> Iterator[BoundField]: ...
|
||||||
def result_list(
|
def result_list(
|
||||||
cl: ChangeList
|
cl: ChangeList
|
||||||
) -> Dict[
|
) -> Dict[str, Union[List[Dict[str, Optional[Union[int, str]]]], List[ResultList], List[BoundField], ChangeList, int]]: ...
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
List[Dict[str, Optional[Union[int, str]]]],
|
|
||||||
List[ResultList],
|
|
||||||
List[BoundField],
|
|
||||||
ChangeList,
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
]: ...
|
|
||||||
def result_list_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
def result_list_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
def date_hierarchy(
|
def date_hierarchy(cl: ChangeList) -> Optional[Dict[str, Union[Dict[str, str], List[Dict[str, str]], bool]]]: ...
|
||||||
cl: ChangeList
|
|
||||||
) -> Optional[Dict[str, Union[Dict[str, str], List[Dict[str, str]], bool]]]: ...
|
|
||||||
def date_hierarchy_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
def date_hierarchy_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
def search_form(cl: ChangeList) -> Dict[str, Union[bool, ChangeList, str]]: ...
|
def search_form(cl: ChangeList) -> Dict[str, Union[bool, ChangeList, str]]: ...
|
||||||
def search_form_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
def search_form_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
def admin_list_filter(cl: ChangeList, spec: FieldListFilter) -> SafeText: ...
|
def admin_list_filter(cl: ChangeList, spec: FieldListFilter) -> SafeText: ...
|
||||||
def admin_actions(context: RequestContext) -> RequestContext: ...
|
def admin_actions(context: RequestContext) -> RequestContext: ...
|
||||||
def admin_actions_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
def admin_actions_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
def change_list_object_tools_tag(
|
def change_list_object_tools_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
parser: Parser, token: Token
|
|
||||||
) -> InclusionAdminNode: ...
|
|
||||||
|
|||||||
@@ -10,12 +10,8 @@ from .base import InclusionAdminNode
|
|||||||
register: Any
|
register: Any
|
||||||
|
|
||||||
def prepopulated_fields_js(context: RequestContext) -> RequestContext: ...
|
def prepopulated_fields_js(context: RequestContext) -> RequestContext: ...
|
||||||
def prepopulated_fields_js_tag(
|
def prepopulated_fields_js_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
parser: Parser, token: Token
|
|
||||||
) -> InclusionAdminNode: ...
|
|
||||||
def submit_row(context: RequestContext) -> Context: ...
|
def submit_row(context: RequestContext) -> Context: ...
|
||||||
def submit_row_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
def submit_row_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
def change_form_object_tools_tag(
|
def change_form_object_tools_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
parser: Parser, token: Token
|
|
||||||
) -> InclusionAdminNode: ...
|
|
||||||
def cell_count(inline_admin_form: InlineAdminForm) -> int: ...
|
def cell_count(inline_admin_form: InlineAdminForm) -> int: ...
|
||||||
|
|||||||
@@ -10,8 +10,5 @@ register: Any
|
|||||||
def admin_urlname(value: Options, arg: SafeText) -> str: ...
|
def admin_urlname(value: Options, arg: SafeText) -> str: ...
|
||||||
def admin_urlquote(value: Union[int, str, UUID]) -> Union[int, str, UUID]: ...
|
def admin_urlquote(value: Union[int, str, UUID]) -> Union[int, str, UUID]: ...
|
||||||
def add_preserved_filters(
|
def add_preserved_filters(
|
||||||
context: Union[Dict[str, Union[Options, str]], RequestContext],
|
context: Union[Dict[str, Union[Options, str]], RequestContext], url: str, popup: bool = ..., to_field: Optional[str] = ...
|
||||||
url: str,
|
|
||||||
popup: bool = ...,
|
|
||||||
to_field: Optional[str] = ...,
|
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
|
|||||||
@@ -5,19 +5,11 @@ from django.template.context import Context
|
|||||||
from django.template.library import InclusionNode
|
from django.template.library import InclusionNode
|
||||||
from django.utils.safestring import SafeText
|
from django.utils.safestring import SafeText
|
||||||
|
|
||||||
|
|
||||||
class InclusionAdminNode(InclusionNode):
|
class InclusionAdminNode(InclusionNode):
|
||||||
args: List[Any]
|
args: List[Any]
|
||||||
func: Callable
|
func: Callable
|
||||||
kwargs: Dict[Any, Any]
|
kwargs: Dict[Any, Any]
|
||||||
takes_context: bool
|
takes_context: bool
|
||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
def __init__(
|
def __init__(self, parser: Parser, token: Token, func: Callable, template_name: str, takes_context: bool = ...) -> None: ...
|
||||||
self,
|
|
||||||
parser: Parser,
|
|
||||||
token: Token,
|
|
||||||
func: Callable,
|
|
||||||
template_name: str,
|
|
||||||
takes_context: bool = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def render(self, context: Context) -> SafeText: ...
|
def render(self, context: Context) -> SafeText: ...
|
||||||
|
|||||||
@@ -10,9 +10,7 @@ class AdminLogNode(template.Node):
|
|||||||
limit: str
|
limit: str
|
||||||
user: str
|
user: str
|
||||||
varname: str
|
varname: str
|
||||||
def __init__(
|
def __init__(self, limit: str, varname: str, user: Optional[str]) -> None: ...
|
||||||
self, limit: str, varname: str, user: Optional[str]
|
|
||||||
) -> None: ...
|
|
||||||
def render(self, context: Context) -> str: ...
|
def render(self, context: Context) -> str: ...
|
||||||
|
|
||||||
def get_admin_log(parser: Parser, token: Token) -> AdminLogNode: ...
|
def get_admin_log(parser: Parser, token: Token) -> AdminLogNode: ...
|
||||||
|
|||||||
@@ -10,35 +10,24 @@ from django.db.models.base import Model
|
|||||||
from django.db.models.deletion import Collector
|
from django.db.models.deletion import Collector
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import Field
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
from django.db.models.fields.mixins import FieldCacheMixin
|
||||||
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
from django.db.models.fields.reverse_related import ForeignObjectRel, ManyToOneRel, OneToOneRel
|
||||||
ManyToOneRel, OneToOneRel)
|
|
||||||
from django.db.models.options import Options
|
from django.db.models.options import Options
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from django.utils.safestring import SafeText
|
from django.utils.safestring import SafeText
|
||||||
|
|
||||||
|
|
||||||
class FieldIsAForeignKeyColumnName(Exception): ...
|
class FieldIsAForeignKeyColumnName(Exception): ...
|
||||||
|
|
||||||
def lookup_needs_distinct(opts: Options, lookup_path: str) -> bool: ...
|
def lookup_needs_distinct(opts: Options, lookup_path: str) -> bool: ...
|
||||||
def prepare_lookup_value(
|
def prepare_lookup_value(key: str, value: Union[datetime, str]) -> Union[bool, datetime, str]: ...
|
||||||
key: str, value: Union[datetime, str]
|
|
||||||
) -> Union[bool, datetime, str]: ...
|
|
||||||
def quote(s: Union[int, str, UUID]) -> Union[int, str, UUID]: ...
|
def quote(s: Union[int, str, UUID]) -> Union[int, str, UUID]: ...
|
||||||
def unquote(s: str) -> str: ...
|
def unquote(s: str) -> str: ...
|
||||||
def flatten(
|
def flatten(
|
||||||
fields: Union[
|
fields: Union[List[Union[Callable, str]], List[Union[List[str], str]], List[Union[Tuple[str, str], str]], Tuple]
|
||||||
List[Union[Callable, str]],
|
|
||||||
List[Union[List[str], str]],
|
|
||||||
List[Union[Tuple[str, str], str]],
|
|
||||||
Tuple,
|
|
||||||
]
|
|
||||||
) -> List[Union[Callable, str]]: ...
|
) -> List[Union[Callable, str]]: ...
|
||||||
def flatten_fieldsets(
|
def flatten_fieldsets(
|
||||||
fieldsets: Union[
|
fieldsets: Union[
|
||||||
List[Tuple[Optional[str], Dict[str, Tuple[str]]]],
|
List[Tuple[Optional[str], Dict[str, Tuple[str]]]],
|
||||||
Tuple[
|
Tuple[Tuple[Optional[str], Dict[str, Tuple[Union[Tuple[str, str], str]]]]],
|
||||||
Tuple[Optional[str], Dict[str, Tuple[Union[Tuple[str, str], str]]]]
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
) -> List[Union[Callable, str]]: ...
|
) -> List[Union[Callable, str]]: ...
|
||||||
def get_deleted_objects(
|
def get_deleted_objects(
|
||||||
@@ -63,48 +52,27 @@ class NestedObjects(Collector):
|
|||||||
source_attr: Optional[str] = ...,
|
source_attr: Optional[str] = ...,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def related_objects(
|
def related_objects(self, related: ManyToOneRel, objs: List[Model]) -> QuerySet: ...
|
||||||
self, related: ManyToOneRel, objs: List[Model]
|
def nested(self, format_callback: Callable = ...) -> Union[List[SafeText], List[int]]: ...
|
||||||
) -> QuerySet: ...
|
|
||||||
def nested(
|
|
||||||
self, format_callback: Callable = ...
|
|
||||||
) -> Union[List[SafeText], List[int]]: ...
|
|
||||||
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ...
|
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ...
|
||||||
|
|
||||||
def model_format_dict(obj: Any): ...
|
def model_format_dict(obj: Any): ...
|
||||||
def model_ngettext(
|
def model_ngettext(obj: Union[Options, QuerySet], n: Optional[int] = ...) -> str: ...
|
||||||
obj: Union[Options, QuerySet], n: Optional[int] = ...
|
|
||||||
) -> str: ...
|
|
||||||
def lookup_field(
|
def lookup_field(
|
||||||
name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ...
|
name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ...
|
||||||
) -> Tuple[Optional[Field], Callable, Callable]: ...
|
) -> Tuple[Optional[Field], Callable, Callable]: ...
|
||||||
def label_for_field(
|
def label_for_field(
|
||||||
name: Union[Callable, str],
|
name: Union[Callable, str], model: Type[Model], model_admin: Optional[BaseModelAdmin] = ..., return_attr: bool = ...
|
||||||
model: Type[Model],
|
|
||||||
model_admin: Optional[BaseModelAdmin] = ...,
|
|
||||||
return_attr: bool = ...,
|
|
||||||
) -> Union[Tuple[Optional[str], Union[Callable, Type[str]]], str]: ...
|
) -> Union[Tuple[Optional[str], Union[Callable, Type[str]]], str]: ...
|
||||||
def help_text_for_field(name: str, model: Type[Model]) -> str: ...
|
def help_text_for_field(name: str, model: Type[Model]) -> str: ...
|
||||||
def display_for_field(
|
def display_for_field(value: Any, field: Union[Field, reverse_related.OneToOneRel], empty_value_display: str) -> str: ...
|
||||||
value: Any,
|
def display_for_value(value: Any, empty_value_display: str, boolean: bool = ...) -> str: ...
|
||||||
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): ...
|
class NotRelationField(Exception): ...
|
||||||
|
|
||||||
def get_model_from_relation(
|
def get_model_from_relation(field: Union[Field, reverse_related.ForeignObjectRel]) -> Type[Model]: ...
|
||||||
field: Union[Field, reverse_related.ForeignObjectRel]
|
def reverse_field_path(model: Type[Model], path: str) -> Tuple[Type[Model], str]: ...
|
||||||
) -> Type[Model]: ...
|
def get_fields_from_path(model: Type[Model], path: str) -> List[Union[Field, FieldCacheMixin]]: ...
|
||||||
def reverse_field_path(
|
|
||||||
model: Type[Model], path: str
|
|
||||||
) -> Tuple[Type[Model], str]: ...
|
|
||||||
def get_fields_from_path(
|
|
||||||
model: Type[Model], path: str
|
|
||||||
) -> List[Union[Field, FieldCacheMixin]]: ...
|
|
||||||
def construct_change_message(
|
def construct_change_message(
|
||||||
form: AdminPasswordChangeForm, formsets: None, add: bool
|
form: AdminPasswordChangeForm, formsets: None, add: bool
|
||||||
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||||
|
|||||||
@@ -6,16 +6,13 @@ from django.db.models.query import QuerySet
|
|||||||
from django.http.response import JsonResponse
|
from django.http.response import JsonResponse
|
||||||
from django.views.generic.list import BaseListView
|
from django.views.generic.list import BaseListView
|
||||||
|
|
||||||
|
|
||||||
class AutocompleteJsonView(BaseListView):
|
class AutocompleteJsonView(BaseListView):
|
||||||
paginate_by: int = ...
|
paginate_by: int = ...
|
||||||
model_admin: django.contrib.admin.options.ModelAdmin = ...
|
model_admin: django.contrib.admin.options.ModelAdmin = ...
|
||||||
term: Any = ...
|
term: Any = ...
|
||||||
paginator_class: Any = ...
|
paginator_class: Any = ...
|
||||||
object_list: Any = ...
|
object_list: Any = ...
|
||||||
def get(
|
def get(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> JsonResponse: ...
|
||||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
|
||||||
) -> JsonResponse: ...
|
|
||||||
def get_paginator(self, *args: Any, **kwargs: Any) -> Paginator: ...
|
def get_paginator(self, *args: Any, **kwargs: Any) -> Paginator: ...
|
||||||
def get_queryset(self) -> QuerySet: ...
|
def get_queryset(self) -> QuerySet: ...
|
||||||
def has_perm(self, request: WSGIRequest, obj: None = ...) -> bool: ...
|
def has_perm(self, request: WSGIRequest, obj: None = ...) -> bool: ...
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
from typing import Any, Callable, Optional
|
from typing import Any, Callable, Optional
|
||||||
|
|
||||||
|
|
||||||
def staff_member_required(
|
def staff_member_required(
|
||||||
view_func: Optional[Callable] = ...,
|
view_func: Optional[Callable] = ..., redirect_field_name: str = ..., login_url: str = ...
|
||||||
redirect_field_name: str = ...,
|
|
||||||
login_url: str = ...,
|
|
||||||
) -> Callable: ...
|
) -> Callable: ...
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ from django.contrib.admin.filters import ListFilter, SimpleListFilter
|
|||||||
from django.contrib.admin.options import ModelAdmin
|
from django.contrib.admin.options import ModelAdmin
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.expressions import (Combinable, CombinedExpression,
|
from django.db.models.expressions import Combinable, CombinedExpression, OrderBy
|
||||||
OrderBy)
|
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
ALL_VAR: str
|
ALL_VAR: str
|
||||||
@@ -48,9 +47,7 @@ class ChangeList:
|
|||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
model: Type[Model],
|
model: Type[Model],
|
||||||
list_display: Union[List[Union[Callable, str]], Tuple[str]],
|
list_display: Union[List[Union[Callable, str]], Tuple[str]],
|
||||||
list_display_links: Optional[
|
list_display_links: Optional[Union[List[Callable], List[str], Tuple[str]]],
|
||||||
Union[List[Callable], List[str], Tuple[str]]
|
|
||||||
],
|
|
||||||
list_filter: Union[List[Type[SimpleListFilter]], List[str], Tuple],
|
list_filter: Union[List[Type[SimpleListFilter]], List[str], Tuple],
|
||||||
date_hierarchy: Optional[str],
|
date_hierarchy: Optional[str],
|
||||||
search_fields: Union[List[str], Tuple],
|
search_fields: Union[List[str], Tuple],
|
||||||
@@ -62,14 +59,8 @@ class ChangeList:
|
|||||||
sortable_by: Union[List[Callable], List[str], Tuple],
|
sortable_by: Union[List[Callable], List[str], Tuple],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_filters_params(self, params: None = ...) -> Dict[str, str]: ...
|
def get_filters_params(self, params: None = ...) -> Dict[str, str]: ...
|
||||||
def get_filters(
|
def get_filters(self, request: WSGIRequest) -> Tuple[List[ListFilter], bool, Dict[str, Union[bool, str]], bool]: ...
|
||||||
self, request: WSGIRequest
|
def get_query_string(self, new_params: Optional[Dict[str, None]] = ..., remove: Optional[List[str]] = ...) -> str: ...
|
||||||
) -> Tuple[List[ListFilter], bool, Dict[str, Union[bool, str]], bool]: ...
|
|
||||||
def get_query_string(
|
|
||||||
self,
|
|
||||||
new_params: Optional[Dict[str, None]] = ...,
|
|
||||||
remove: Optional[List[str]] = ...,
|
|
||||||
) -> str: ...
|
|
||||||
result_count: Any = ...
|
result_count: Any = ...
|
||||||
show_full_result_count: Any = ...
|
show_full_result_count: Any = ...
|
||||||
show_admin_actions: Any = ...
|
show_admin_actions: Any = ...
|
||||||
@@ -79,9 +70,7 @@ class ChangeList:
|
|||||||
multi_page: Any = ...
|
multi_page: Any = ...
|
||||||
paginator: Any = ...
|
paginator: Any = ...
|
||||||
def get_results(self, request: WSGIRequest) -> None: ...
|
def get_results(self, request: WSGIRequest) -> None: ...
|
||||||
def get_ordering_field(
|
def get_ordering_field(self, field_name: Union[Callable, str]) -> Optional[Union[CombinedExpression, str]]: ...
|
||||||
self, field_name: Union[Callable, str]
|
|
||||||
) -> Optional[Union[CombinedExpression, str]]: ...
|
|
||||||
def get_ordering(
|
def get_ordering(
|
||||||
self, request: WSGIRequest, queryset: QuerySet
|
self, request: WSGIRequest, queryset: QuerySet
|
||||||
) -> Union[List[Union[Combinable, str]], List[Union[OrderBy, str]]]: ...
|
) -> Union[List[Union[Combinable, str]], List[Union[OrderBy, str]]]: ...
|
||||||
|
|||||||
@@ -12,24 +12,14 @@ from django.forms.widgets import ChoiceWidget, Media, Widget
|
|||||||
from django.http.request import QueryDict
|
from django.http.request import QueryDict
|
||||||
from django.utils.datastructures import MultiValueDict
|
from django.utils.datastructures import MultiValueDict
|
||||||
|
|
||||||
|
|
||||||
class FilteredSelectMultiple(forms.SelectMultiple):
|
class FilteredSelectMultiple(forms.SelectMultiple):
|
||||||
@property
|
@property
|
||||||
def media(self) -> Media: ...
|
def media(self) -> Media: ...
|
||||||
verbose_name: Any = ...
|
verbose_name: Any = ...
|
||||||
is_stacked: Any = ...
|
is_stacked: Any = ...
|
||||||
def __init__(
|
def __init__(self, verbose_name: str, is_stacked: bool, attrs: None = ..., choices: Tuple = ...) -> None: ...
|
||||||
self,
|
|
||||||
verbose_name: str,
|
|
||||||
is_stacked: bool,
|
|
||||||
attrs: None = ...,
|
|
||||||
choices: Tuple = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def get_context(
|
def get_context(
|
||||||
self,
|
self, name: str, value: Union[List[Any], str], attrs: Optional[Dict[str, str]]
|
||||||
name: str,
|
|
||||||
value: Union[List[Any], str],
|
|
||||||
attrs: Optional[Dict[str, str]],
|
|
||||||
) -> Dict[
|
) -> Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
@@ -37,13 +27,7 @@ class FilteredSelectMultiple(forms.SelectMultiple):
|
|||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[int, str]],
|
Dict[str, Union[int, str]],
|
||||||
List[
|
List[Tuple[None, List[Dict[str, Union[Dict[Any, Any], int, str]]], int]],
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[Dict[str, Union[Dict[Any, Any], int, str]]],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
bool,
|
bool,
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
@@ -57,22 +41,14 @@ class AdminDateWidget(forms.DateInput):
|
|||||||
input_type: str
|
input_type: str
|
||||||
@property
|
@property
|
||||||
def media(self) -> Media: ...
|
def media(self) -> Media: ...
|
||||||
def __init__(
|
def __init__(self, attrs: Optional[Dict[str, Union[int, str]]] = ..., format: None = ...) -> None: ...
|
||||||
self,
|
|
||||||
attrs: Optional[Dict[str, Union[int, str]]] = ...,
|
|
||||||
format: None = ...,
|
|
||||||
) -> None: ...
|
|
||||||
|
|
||||||
class AdminTimeWidget(forms.TimeInput):
|
class AdminTimeWidget(forms.TimeInput):
|
||||||
attrs: Dict[str, str]
|
attrs: Dict[str, str]
|
||||||
input_type: str
|
input_type: str
|
||||||
@property
|
@property
|
||||||
def media(self) -> Media: ...
|
def media(self) -> Media: ...
|
||||||
def __init__(
|
def __init__(self, attrs: Optional[Dict[str, Union[int, str]]] = ..., format: None = ...) -> None: ...
|
||||||
self,
|
|
||||||
attrs: Optional[Dict[str, Union[int, str]]] = ...,
|
|
||||||
format: None = ...,
|
|
||||||
) -> None: ...
|
|
||||||
|
|
||||||
class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
||||||
attrs: Dict[Any, Any]
|
attrs: Dict[Any, Any]
|
||||||
@@ -80,10 +56,7 @@ class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
|||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
def __init__(self, attrs: None = ...) -> None: ...
|
def __init__(self, attrs: None = ...) -> None: ...
|
||||||
def get_context(
|
def get_context(
|
||||||
self,
|
self, name: str, value: Optional[Union[List[str], datetime]], attrs: Optional[Dict[str, Union[bool, str]]]
|
||||||
name: str,
|
|
||||||
value: Optional[Union[List[str], datetime]],
|
|
||||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
|
||||||
) -> Dict[
|
) -> Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
@@ -92,16 +65,7 @@ class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
|||||||
Optional[
|
Optional[
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[bool, str]],
|
Dict[str, Union[bool, str]],
|
||||||
List[
|
List[Dict[str, Optional[Union[Dict[str, Union[bool, str]], bool, str]]]],
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]], bool, str
|
|
||||||
]
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
bool,
|
bool,
|
||||||
str,
|
str,
|
||||||
]
|
]
|
||||||
@@ -120,14 +84,7 @@ class AdminFileWidget(forms.ClearableFileInput):
|
|||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
|
|
||||||
def url_params_from_lookup_dict(
|
def url_params_from_lookup_dict(
|
||||||
lookups: Union[
|
lookups: Union[Dict[str, Callable], Dict[str, List[str]], Dict[str, Tuple[str, str]], Dict[str, bool], Dict[str, str], Q]
|
||||||
Dict[str, Callable],
|
|
||||||
Dict[str, List[str]],
|
|
||||||
Dict[str, Tuple[str, str]],
|
|
||||||
Dict[str, bool],
|
|
||||||
Dict[str, str],
|
|
||||||
Q,
|
|
||||||
]
|
|
||||||
) -> Dict[str, str]: ...
|
) -> Dict[str, str]: ...
|
||||||
|
|
||||||
class ForeignKeyRawIdWidget(forms.TextInput):
|
class ForeignKeyRawIdWidget(forms.TextInput):
|
||||||
@@ -136,30 +93,13 @@ class ForeignKeyRawIdWidget(forms.TextInput):
|
|||||||
rel: django.db.models.fields.reverse_related.ManyToOneRel = ...
|
rel: django.db.models.fields.reverse_related.ManyToOneRel = ...
|
||||||
admin_site: django.contrib.admin.sites.AdminSite = ...
|
admin_site: django.contrib.admin.sites.AdminSite = ...
|
||||||
db: None = ...
|
db: None = ...
|
||||||
def __init__(
|
def __init__(self, rel: ForeignObjectRel, admin_site: AdminSite, attrs: None = ..., using: None = ...) -> None: ...
|
||||||
self,
|
|
||||||
rel: ForeignObjectRel,
|
|
||||||
admin_site: AdminSite,
|
|
||||||
attrs: None = ...,
|
|
||||||
using: None = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def get_context(
|
def get_context(
|
||||||
self,
|
self, name: str, value: Optional[Union[List[int], int, str, UUID]], attrs: Optional[Dict[str, Union[bool, str]]]
|
||||||
name: str,
|
) -> Dict[str, Union[Dict[str, Optional[Union[Dict[str, Union[bool, str]], bool, str]]], str]]: ...
|
||||||
value: Optional[Union[List[int], int, str, UUID]],
|
|
||||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
|
||||||
) -> Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Optional[Union[Dict[str, Union[bool, str]], bool, str]]],
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]: ...
|
|
||||||
def base_url_parameters(self) -> Dict[str, str]: ...
|
def base_url_parameters(self) -> Dict[str, str]: ...
|
||||||
def url_parameters(self) -> Dict[str, str]: ...
|
def url_parameters(self) -> Dict[str, str]: ...
|
||||||
def label_and_url_for_value(
|
def label_and_url_for_value(self, value: Union[int, str, UUID]) -> Tuple[str, str]: ...
|
||||||
self, value: Union[int, str, UUID]
|
|
||||||
) -> Tuple[str, str]: ...
|
|
||||||
|
|
||||||
class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
|
class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
|
||||||
admin_site: django.contrib.admin.sites.AdminSite
|
admin_site: django.contrib.admin.sites.AdminSite
|
||||||
@@ -168,16 +108,11 @@ class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
|
|||||||
rel: django.db.models.fields.reverse_related.ManyToManyRel
|
rel: django.db.models.fields.reverse_related.ManyToManyRel
|
||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
def get_context(
|
def get_context(
|
||||||
self,
|
self, name: str, value: Optional[List[int]], attrs: Optional[Dict[str, str]]
|
||||||
name: str,
|
|
||||||
value: Optional[List[int]],
|
|
||||||
attrs: Optional[Dict[str, str]],
|
|
||||||
) -> Dict[str, Union[Dict[str, Union[Dict[str, str], bool, str]], str]]: ...
|
) -> Dict[str, Union[Dict[str, Union[Dict[str, str], bool, str]], str]]: ...
|
||||||
def url_parameters(self) -> Dict[Any, Any]: ...
|
def url_parameters(self) -> Dict[Any, Any]: ...
|
||||||
def label_and_url_for_value(self, value: List[int]) -> Tuple[str, str]: ...
|
def label_and_url_for_value(self, value: List[int]) -> Tuple[str, str]: ...
|
||||||
def value_from_datadict(
|
def value_from_datadict(self, data: QueryDict, files: MultiValueDict, name: str) -> None: ...
|
||||||
self, data: QueryDict, files: MultiValueDict, name: str
|
|
||||||
) -> None: ...
|
|
||||||
def format_value(self, value: Optional[List[int]]) -> str: ...
|
def format_value(self, value: Optional[List[int]]) -> str: ...
|
||||||
|
|
||||||
class RelatedFieldWidgetWrapper(forms.Widget):
|
class RelatedFieldWidgetWrapper(forms.Widget):
|
||||||
@@ -203,30 +138,18 @@ class RelatedFieldWidgetWrapper(forms.Widget):
|
|||||||
can_view_related: bool = ...,
|
can_view_related: bool = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __deepcopy__(
|
def __deepcopy__(
|
||||||
self,
|
self, memo: Dict[int, Union[List[Union[Field, Widget]], OrderedDict, Field, Widget]]
|
||||||
memo: Dict[
|
|
||||||
int, Union[List[Union[Field, Widget]], OrderedDict, Field, Widget]
|
|
||||||
],
|
|
||||||
) -> RelatedFieldWidgetWrapper: ...
|
) -> RelatedFieldWidgetWrapper: ...
|
||||||
@property
|
@property
|
||||||
def is_hidden(self) -> bool: ...
|
def is_hidden(self) -> bool: ...
|
||||||
@property
|
@property
|
||||||
def media(self) -> Media: ...
|
def media(self) -> Media: ...
|
||||||
def get_related_url(
|
def get_related_url(self, info: Tuple[str, str], action: str, *args: Any) -> str: ...
|
||||||
self, info: Tuple[str, str], action: str, *args: Any
|
|
||||||
) -> str: ...
|
|
||||||
def get_context(
|
def get_context(
|
||||||
self,
|
self, name: str, value: Optional[Union[int, str]], attrs: Optional[Dict[str, Union[bool, str]]]
|
||||||
name: str,
|
|
||||||
value: Optional[Union[int, str]],
|
|
||||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
|
||||||
) -> Dict[str, Union[bool, str]]: ...
|
) -> Dict[str, Union[bool, str]]: ...
|
||||||
def value_from_datadict(
|
def value_from_datadict(self, data: QueryDict, files: MultiValueDict, name: str) -> Optional[Union[List[str], str]]: ...
|
||||||
self, data: QueryDict, files: MultiValueDict, name: str
|
def value_omitted_from_data(self, data: Dict[Any, Any], files: Dict[Any, Any], name: str) -> bool: ...
|
||||||
) -> Optional[Union[List[str], str]]: ...
|
|
||||||
def value_omitted_from_data(
|
|
||||||
self, data: Dict[Any, Any], files: Dict[Any, Any], name: str
|
|
||||||
) -> bool: ...
|
|
||||||
def id_for_label(self, id_: str) -> str: ...
|
def id_for_label(self, id_: str) -> str: ...
|
||||||
|
|
||||||
class AdminTextareaWidget(forms.Textarea):
|
class AdminTextareaWidget(forms.Textarea):
|
||||||
@@ -250,9 +173,7 @@ class AdminURLFieldWidget(forms.URLInput):
|
|||||||
def __init__(self, attrs: None = ...) -> None: ...
|
def __init__(self, attrs: None = ...) -> None: ...
|
||||||
def get_context(
|
def get_context(
|
||||||
self, name: str, value: Optional[str], attrs: Optional[Dict[str, str]]
|
self, name: str, value: Optional[str], attrs: Optional[Dict[str, str]]
|
||||||
) -> Dict[
|
) -> Dict[str, Union[Dict[str, Optional[Union[Dict[str, str], bool, str]]], str]]: ...
|
||||||
str, Union[Dict[str, Optional[Union[Dict[str, str], bool, str]]], str]
|
|
||||||
]: ...
|
|
||||||
|
|
||||||
class AdminIntegerFieldWidget(forms.NumberInput):
|
class AdminIntegerFieldWidget(forms.NumberInput):
|
||||||
attrs: Dict[str, str]
|
attrs: Dict[str, str]
|
||||||
@@ -282,22 +203,11 @@ class AutocompleteMixin:
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_url(self) -> str: ...
|
def get_url(self) -> str: ...
|
||||||
def build_attrs(
|
def build_attrs(
|
||||||
self,
|
self, base_attrs: Dict[str, str], extra_attrs: Optional[Dict[str, Union[bool, str]]] = ...
|
||||||
base_attrs: Dict[str, str],
|
|
||||||
extra_attrs: Optional[Dict[str, Union[bool, str]]] = ...,
|
|
||||||
) -> Dict[str, Union[bool, str]]: ...
|
) -> Dict[str, Union[bool, str]]: ...
|
||||||
def optgroups(
|
def optgroups(
|
||||||
self,
|
self, name: str, value: List[str], attr: Dict[str, Union[bool, str]] = ...
|
||||||
name: str,
|
) -> List[Tuple[None, List[Dict[str, Union[Dict[str, bool], Set[str], int, str]]], int]]: ...
|
||||||
value: List[str],
|
|
||||||
attr: Dict[str, Union[bool, str]] = ...,
|
|
||||||
) -> List[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[Dict[str, Union[Dict[str, bool], Set[str], int, str]]],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
@property
|
@property
|
||||||
def media(self) -> Media: ...
|
def media(self) -> Media: ...
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,8 @@ from django.core.handlers.wsgi import WSGIRequest
|
|||||||
from django.http.response import HttpResponse
|
from django.http.response import HttpResponse
|
||||||
from django.utils.deprecation import MiddlewareMixin
|
from django.utils.deprecation import MiddlewareMixin
|
||||||
|
|
||||||
|
|
||||||
class XViewMiddleware(MiddlewareMixin):
|
class XViewMiddleware(MiddlewareMixin):
|
||||||
get_response: None
|
get_response: None
|
||||||
def process_view(
|
def process_view(
|
||||||
self,
|
self, request: WSGIRequest, view_func: Callable, view_args: Tuple, view_kwargs: Dict[Any, Any]
|
||||||
request: WSGIRequest,
|
|
||||||
view_func: Callable,
|
|
||||||
view_args: Tuple,
|
|
||||||
view_kwargs: Dict[Any, Any],
|
|
||||||
) -> Optional[HttpResponse]: ...
|
) -> Optional[HttpResponse]: ...
|
||||||
|
|||||||
@@ -5,23 +5,13 @@ docutils_is_available: bool
|
|||||||
def get_view_name(view_func: Callable) -> str: ...
|
def get_view_name(view_func: Callable) -> str: ...
|
||||||
def trim_docstring(docstring: Any): ...
|
def trim_docstring(docstring: Any): ...
|
||||||
def parse_docstring(docstring: Any): ...
|
def parse_docstring(docstring: Any): ...
|
||||||
def parse_rst(
|
def parse_rst(text: Any, default_reference_context: Any, thing_being_parsed: Optional[Any] = ...): ...
|
||||||
text: Any,
|
|
||||||
default_reference_context: Any,
|
|
||||||
thing_being_parsed: Optional[Any] = ...,
|
|
||||||
): ...
|
|
||||||
|
|
||||||
ROLES: Any
|
ROLES: Any
|
||||||
|
|
||||||
def create_reference_role(rolename: Any, urlbase: Any): ...
|
def create_reference_role(rolename: Any, urlbase: Any): ...
|
||||||
def default_reference_role(
|
def default_reference_role(
|
||||||
name: Any,
|
name: Any, rawtext: Any, text: Any, lineno: Any, inliner: Any, options: Optional[Any] = ..., content: Optional[Any] = ...
|
||||||
rawtext: Any,
|
|
||||||
text: Any,
|
|
||||||
lineno: Any,
|
|
||||||
inliner: Any,
|
|
||||||
options: Optional[Any] = ...,
|
|
||||||
content: Optional[Any] = ...,
|
|
||||||
): ...
|
): ...
|
||||||
|
|
||||||
named_group_matcher: Any
|
named_group_matcher: Any
|
||||||
|
|||||||
@@ -46,7 +46,5 @@ class TemplateDetailView(BaseAdminDocsView):
|
|||||||
|
|
||||||
def get_return_data_type(func_name: Any): ...
|
def get_return_data_type(func_name: Any): ...
|
||||||
def get_readable_field_data_type(field: Union[Field, str]) -> str: ...
|
def get_readable_field_data_type(field: Union[Field, str]) -> str: ...
|
||||||
def extract_views_from_urlpatterns(
|
def extract_views_from_urlpatterns(urlpatterns: Any, base: str = ..., namespace: Optional[Any] = ...): ...
|
||||||
urlpatterns: Any, base: str = ..., namespace: Optional[Any] = ...
|
|
||||||
): ...
|
|
||||||
def simplify_regex(pattern: str) -> str: ...
|
def simplify_regex(pattern: str) -> str: ...
|
||||||
|
|||||||
@@ -17,22 +17,12 @@ REDIRECT_FIELD_NAME: str
|
|||||||
|
|
||||||
def load_backend(path: str) -> ModelBackend: ...
|
def load_backend(path: str) -> ModelBackend: ...
|
||||||
def get_backends() -> List[ModelBackend]: ...
|
def get_backends() -> List[ModelBackend]: ...
|
||||||
def authenticate(
|
def authenticate(request: Any = ..., **credentials: Any) -> Optional[AbstractBaseUser]: ...
|
||||||
request: Any = ..., **credentials: Any
|
def login(request: HttpRequest, user: AbstractBaseUser, backend: Optional[Union[Type[ModelBackend], str]] = ...) -> None: ...
|
||||||
) -> Optional[AbstractBaseUser]: ...
|
|
||||||
def login(
|
|
||||||
request: HttpRequest,
|
|
||||||
user: AbstractBaseUser,
|
|
||||||
backend: Optional[Union[Type[ModelBackend], str]] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def logout(request: HttpRequest) -> None: ...
|
def logout(request: HttpRequest) -> None: ...
|
||||||
def get_user_model() -> Type[Model]: ...
|
def get_user_model() -> Type[Model]: ...
|
||||||
def get_user(
|
def get_user(request: HttpRequest) -> Union[AbstractBaseUser, AnonymousUser]: ...
|
||||||
request: HttpRequest
|
|
||||||
) -> Union[AbstractBaseUser, AnonymousUser]: ...
|
|
||||||
def get_permission_codename(action: str, opts: Options) -> str: ...
|
def get_permission_codename(action: str, opts: Options) -> str: ...
|
||||||
def update_session_auth_hash(
|
def update_session_auth_hash(request: WSGIRequest, user: AbstractUser) -> None: ...
|
||||||
request: WSGIRequest, user: AbstractUser
|
|
||||||
) -> None: ...
|
|
||||||
|
|
||||||
default_app_config: str
|
default_app_config: str
|
||||||
|
|||||||
@@ -14,21 +14,8 @@ sensitive_post_parameters_m: Any
|
|||||||
class GroupAdmin(admin.ModelAdmin):
|
class GroupAdmin(admin.ModelAdmin):
|
||||||
admin_site: django.contrib.admin.sites.AdminSite
|
admin_site: django.contrib.admin.sites.AdminSite
|
||||||
formfield_overrides: Dict[
|
formfield_overrides: Dict[
|
||||||
Type[
|
Type[Union[django.db.models.fields.DateTimeCheckMixin, django.db.models.fields.Field]],
|
||||||
Union[
|
Dict[str, Type[Union[django.forms.fields.SplitDateTimeField, django.forms.widgets.Widget]]],
|
||||||
django.db.models.fields.DateTimeCheckMixin,
|
|
||||||
django.db.models.fields.Field,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Type[
|
|
||||||
Union[
|
|
||||||
django.forms.fields.SplitDateTimeField,
|
|
||||||
django.forms.widgets.Widget,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
model: Type[django.contrib.auth.models.Group]
|
model: Type[django.contrib.auth.models.Group]
|
||||||
opts: django.db.models.options.Options
|
opts: django.db.models.options.Options
|
||||||
@@ -36,30 +23,14 @@ class GroupAdmin(admin.ModelAdmin):
|
|||||||
ordering: Any = ...
|
ordering: Any = ...
|
||||||
filter_horizontal: Any = ...
|
filter_horizontal: Any = ...
|
||||||
def formfield_for_manytomany(
|
def formfield_for_manytomany(
|
||||||
self,
|
self, db_field: ManyToManyField, request: WSGIRequest = ..., **kwargs: Any
|
||||||
db_field: ManyToManyField,
|
|
||||||
request: WSGIRequest = ...,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> ModelMultipleChoiceField: ...
|
) -> ModelMultipleChoiceField: ...
|
||||||
|
|
||||||
class UserAdmin(admin.ModelAdmin):
|
class UserAdmin(admin.ModelAdmin):
|
||||||
admin_site: django.contrib.admin.sites.AdminSite
|
admin_site: django.contrib.admin.sites.AdminSite
|
||||||
formfield_overrides: Dict[
|
formfield_overrides: Dict[
|
||||||
Type[
|
Type[Union[django.db.models.fields.DateTimeCheckMixin, django.db.models.fields.Field]],
|
||||||
Union[
|
Dict[str, Type[Union[django.forms.fields.SplitDateTimeField, django.forms.widgets.Widget]]],
|
||||||
django.db.models.fields.DateTimeCheckMixin,
|
|
||||||
django.db.models.fields.Field,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Type[
|
|
||||||
Union[
|
|
||||||
django.forms.fields.SplitDateTimeField,
|
|
||||||
django.forms.widgets.Widget,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
model: Type[django.contrib.auth.models.User]
|
model: Type[django.contrib.auth.models.User]
|
||||||
opts: django.db.models.options.Options
|
opts: django.db.models.options.Options
|
||||||
@@ -75,23 +46,10 @@ class UserAdmin(admin.ModelAdmin):
|
|||||||
search_fields: Any = ...
|
search_fields: Any = ...
|
||||||
ordering: Any = ...
|
ordering: Any = ...
|
||||||
filter_horizontal: Any = ...
|
filter_horizontal: Any = ...
|
||||||
def get_fieldsets(
|
def get_fieldsets(self, request: WSGIRequest, obj: None = ...) -> Tuple[Tuple[None, Dict[str, Tuple[str]]]]: ...
|
||||||
self, request: WSGIRequest, obj: None = ...
|
def get_form(self, request: Any, obj: Optional[Any] = ..., **kwargs: Any): ...
|
||||||
) -> Tuple[Tuple[None, Dict[str, Tuple[str]]]]: ...
|
|
||||||
def get_form(
|
|
||||||
self, request: Any, obj: Optional[Any] = ..., **kwargs: Any
|
|
||||||
): ...
|
|
||||||
def get_urls(self) -> List[URLPattern]: ...
|
def get_urls(self) -> List[URLPattern]: ...
|
||||||
def lookup_allowed(self, lookup: str, value: str) -> bool: ...
|
def lookup_allowed(self, lookup: str, value: str) -> bool: ...
|
||||||
def add_view(
|
def add_view(self, request: WSGIRequest, form_url: str = ..., extra_context: None = ...) -> Any: ...
|
||||||
self,
|
def user_change_password(self, request: WSGIRequest, id: str, form_url: str = ...) -> HttpResponse: ...
|
||||||
request: WSGIRequest,
|
def response_add(self, request: WSGIRequest, obj: User, post_url_continue: None = ...) -> HttpResponse: ...
|
||||||
form_url: str = ...,
|
|
||||||
extra_context: None = ...,
|
|
||||||
) -> Any: ...
|
|
||||||
def user_change_password(
|
|
||||||
self, request: WSGIRequest, id: str, form_url: str = ...
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
def response_add(
|
|
||||||
self, request: WSGIRequest, obj: User, post_url_continue: None = ...
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ from .checks import check_models_permissions, check_user_model
|
|||||||
from .management import create_permissions
|
from .management import create_permissions
|
||||||
from .signals import user_logged_in
|
from .signals import user_logged_in
|
||||||
|
|
||||||
|
|
||||||
class AuthConfig(AppConfig):
|
class AuthConfig(AppConfig):
|
||||||
apps: None
|
apps: None
|
||||||
label: str
|
label: str
|
||||||
|
|||||||
@@ -8,33 +8,14 @@ UserModel: Any
|
|||||||
|
|
||||||
class ModelBackend:
|
class ModelBackend:
|
||||||
def authenticate(
|
def authenticate(
|
||||||
self,
|
self, request: Any, username: Optional[Union[int, str]] = ..., password: Optional[str] = ..., **kwargs: Any
|
||||||
request: Any,
|
|
||||||
username: Optional[Union[int, str]] = ...,
|
|
||||||
password: Optional[str] = ...,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> Optional[AbstractBaseUser]: ...
|
) -> Optional[AbstractBaseUser]: ...
|
||||||
def user_can_authenticate(
|
def user_can_authenticate(self, user: Optional[AbstractBaseUser]) -> bool: ...
|
||||||
self, user: Optional[AbstractBaseUser]
|
def get_user_permissions(self, user_obj: AbstractBaseUser, obj: None = ...) -> Set[str]: ...
|
||||||
) -> bool: ...
|
def get_group_permissions(self, user_obj: AbstractBaseUser, obj: None = ...) -> Set[str]: ...
|
||||||
def get_user_permissions(
|
def get_all_permissions(self, user_obj: AbstractBaseUser, obj: Optional[str] = ...) -> Set[str]: ...
|
||||||
self, user_obj: AbstractBaseUser, obj: None = ...
|
def has_perm(self, user_obj: Union[AbstractBaseUser, AnonymousUser], perm: str, obj: Optional[str] = ...) -> bool: ...
|
||||||
) -> Set[str]: ...
|
def has_module_perms(self, user_obj: Union[AbstractBaseUser, AnonymousUser], app_label: str) -> bool: ...
|
||||||
def get_group_permissions(
|
|
||||||
self, user_obj: AbstractBaseUser, obj: None = ...
|
|
||||||
) -> Set[str]: ...
|
|
||||||
def get_all_permissions(
|
|
||||||
self, user_obj: AbstractBaseUser, obj: Optional[str] = ...
|
|
||||||
) -> Set[str]: ...
|
|
||||||
def has_perm(
|
|
||||||
self,
|
|
||||||
user_obj: Union[AbstractBaseUser, AnonymousUser],
|
|
||||||
perm: str,
|
|
||||||
obj: Optional[str] = ...,
|
|
||||||
) -> bool: ...
|
|
||||||
def has_module_perms(
|
|
||||||
self, user_obj: Union[AbstractBaseUser, AnonymousUser], app_label: str
|
|
||||||
) -> bool: ...
|
|
||||||
def get_user(self, user_id: int) -> AbstractBaseUser: ...
|
def get_user(self, user_id: int) -> AbstractBaseUser: ...
|
||||||
|
|
||||||
class AllowAllUsersModelBackend(ModelBackend):
|
class AllowAllUsersModelBackend(ModelBackend):
|
||||||
@@ -42,9 +23,7 @@ class AllowAllUsersModelBackend(ModelBackend):
|
|||||||
|
|
||||||
class RemoteUserBackend(ModelBackend):
|
class RemoteUserBackend(ModelBackend):
|
||||||
create_unknown_user: bool = ...
|
create_unknown_user: bool = ...
|
||||||
def authenticate(
|
def authenticate(self, request: WSGIRequest, remote_user: Optional[str]) -> Optional[User]: ...
|
||||||
self, request: WSGIRequest, remote_user: Optional[str]
|
|
||||||
) -> Optional[User]: ...
|
|
||||||
def clean_username(self, username: str) -> str: ...
|
def clean_username(self, username: str) -> str: ...
|
||||||
def configure_user(self, user: User) -> User: ...
|
def configure_user(self, user: User) -> User: ...
|
||||||
|
|
||||||
|
|||||||
@@ -2,19 +2,14 @@ from typing import Any, Optional, Tuple, Union
|
|||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class BaseUserManager(models.Manager):
|
class BaseUserManager(models.Manager):
|
||||||
creation_counter: int
|
creation_counter: int
|
||||||
model: None
|
model: None
|
||||||
name: None
|
name: None
|
||||||
@classmethod
|
@classmethod
|
||||||
def normalize_email(cls, email: Optional[str]) -> str: ...
|
def normalize_email(cls, email: Optional[str]) -> str: ...
|
||||||
def make_random_password(
|
def make_random_password(self, length: int = ..., allowed_chars: str = ...) -> str: ...
|
||||||
self, length: int = ..., allowed_chars: str = ...
|
def get_by_natural_key(self, username: Optional[str]) -> AbstractBaseUser: ...
|
||||||
) -> str: ...
|
|
||||||
def get_by_natural_key(
|
|
||||||
self, username: Optional[str]
|
|
||||||
) -> AbstractBaseUser: ...
|
|
||||||
|
|
||||||
class AbstractBaseUser(models.Model):
|
class AbstractBaseUser(models.Model):
|
||||||
password: str = ...
|
password: str = ...
|
||||||
@@ -39,6 +34,4 @@ class AbstractBaseUser(models.Model):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_email_field_name(cls) -> str: ...
|
def get_email_field_name(cls) -> str: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
def normalize_username(
|
def normalize_username(cls, username: Union[int, str]) -> Union[int, str]: ...
|
||||||
cls, username: Union[int, str]
|
|
||||||
) -> Union[int, str]: ...
|
|
||||||
|
|||||||
@@ -4,10 +4,5 @@ from django.core.checks.messages import CheckMessage
|
|||||||
|
|
||||||
from .management import _get_builtin_permissions
|
from .management import _get_builtin_permissions
|
||||||
|
|
||||||
|
def check_user_model(app_configs: None = ..., **kwargs: Any) -> List[CheckMessage]: ...
|
||||||
def check_user_model(
|
def check_models_permissions(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||||
app_configs: None = ..., **kwargs: Any
|
|
||||||
) -> List[CheckMessage]: ...
|
|
||||||
def check_models_permissions(
|
|
||||||
app_configs: None = ..., **kwargs: Any
|
|
||||||
) -> List[Any]: ...
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ from django.contrib.auth.models import AnonymousUser, User
|
|||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
from django.utils.functional import SimpleLazyObject
|
from django.utils.functional import SimpleLazyObject
|
||||||
|
|
||||||
|
|
||||||
class PermLookupDict:
|
class PermLookupDict:
|
||||||
app_label: django.utils.safestring.SafeText
|
app_label: django.utils.safestring.SafeText
|
||||||
user: django.utils.functional.SimpleLazyObject
|
user: django.utils.functional.SimpleLazyObject
|
||||||
@@ -20,6 +19,4 @@ class PermWrapper:
|
|||||||
def __iter__(self) -> Any: ...
|
def __iter__(self) -> Any: ...
|
||||||
def __contains__(self, perm_name: Union[bool, str]) -> bool: ...
|
def __contains__(self, perm_name: Union[bool, str]) -> bool: ...
|
||||||
|
|
||||||
def auth(
|
def auth(request: HttpRequest) -> Dict[str, Union[PermWrapper, AnonymousUser, User]]: ...
|
||||||
request: HttpRequest
|
|
||||||
) -> Dict[str, Union[PermWrapper, AnonymousUser, User]]: ...
|
|
||||||
|
|||||||
@@ -1,18 +1,9 @@
|
|||||||
from typing import Any, Callable, List, Optional, Set, Union
|
from typing import Any, Callable, List, Optional, Set, Union
|
||||||
|
|
||||||
|
def user_passes_test(test_func: Callable, login_url: Optional[str] = ..., redirect_field_name: str = ...) -> Callable: ...
|
||||||
def user_passes_test(
|
|
||||||
test_func: Callable,
|
|
||||||
login_url: Optional[str] = ...,
|
|
||||||
redirect_field_name: str = ...,
|
|
||||||
) -> Callable: ...
|
|
||||||
def login_required(
|
def login_required(
|
||||||
function: Optional[Callable] = ...,
|
function: Optional[Callable] = ..., redirect_field_name: str = ..., login_url: Optional[str] = ...
|
||||||
redirect_field_name: str = ...,
|
|
||||||
login_url: Optional[str] = ...,
|
|
||||||
) -> Callable: ...
|
) -> Callable: ...
|
||||||
def permission_required(
|
def permission_required(
|
||||||
perm: Union[List[str], Set[str], str],
|
perm: Union[List[str], Set[str], str], login_url: None = ..., raise_exception: bool = ...
|
||||||
login_url: None = ...,
|
|
||||||
raise_exception: bool = ...,
|
|
||||||
) -> Callable: ...
|
) -> Callable: ...
|
||||||
|
|||||||
@@ -14,13 +14,7 @@ class ReadOnlyPasswordHashWidget(forms.Widget):
|
|||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
def get_context(
|
def get_context(
|
||||||
self, name: str, value: Optional[str], attrs: Dict[str, str]
|
self, name: str, value: Optional[str], attrs: Dict[str, str]
|
||||||
) -> Dict[
|
) -> Dict[str, Union[Dict[str, Optional[Union[Dict[str, str], bool, str]]], List[Dict[str, str]]]]: ...
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Optional[Union[Dict[str, str], bool, str]]],
|
|
||||||
List[Dict[str, str]],
|
|
||||||
],
|
|
||||||
]: ...
|
|
||||||
|
|
||||||
class ReadOnlyPasswordHashField(forms.Field):
|
class ReadOnlyPasswordHashField(forms.Field):
|
||||||
widget: Any = ...
|
widget: Any = ...
|
||||||
@@ -88,9 +82,7 @@ class AuthenticationForm(forms.Form):
|
|||||||
request: django.core.handlers.wsgi.WSGIRequest = ...
|
request: django.core.handlers.wsgi.WSGIRequest = ...
|
||||||
user_cache: None = ...
|
user_cache: None = ...
|
||||||
username_field: Any = ...
|
username_field: Any = ...
|
||||||
def __init__(
|
def __init__(self, request: Any = ..., *args: Any, **kwargs: Any) -> None: ...
|
||||||
self, request: Any = ..., *args: Any, **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
def clean(self) -> Dict[str, str]: ...
|
def clean(self) -> Dict[str, str]: ...
|
||||||
def confirm_login_allowed(self, user: AbstractBaseUser) -> None: ...
|
def confirm_login_allowed(self, user: AbstractBaseUser) -> None: ...
|
||||||
def get_user(self) -> User: ...
|
def get_user(self) -> User: ...
|
||||||
@@ -144,9 +136,7 @@ class SetPasswordForm(forms.Form):
|
|||||||
new_password1: Any = ...
|
new_password1: Any = ...
|
||||||
new_password2: Any = ...
|
new_password2: Any = ...
|
||||||
user: django.contrib.auth.models.User = ...
|
user: django.contrib.auth.models.User = ...
|
||||||
def __init__(
|
def __init__(self, user: Optional[AbstractBaseUser], *args: Any, **kwargs: Any) -> None: ...
|
||||||
self, user: Optional[AbstractBaseUser], *args: Any, **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
def clean_new_password2(self) -> str: ...
|
def clean_new_password2(self) -> str: ...
|
||||||
def save(self, commit: bool = ...) -> AbstractBaseUser: ...
|
def save(self, commit: bool = ...) -> AbstractBaseUser: ...
|
||||||
|
|
||||||
@@ -181,9 +171,7 @@ class AdminPasswordChangeForm(forms.Form):
|
|||||||
password1: Any = ...
|
password1: Any = ...
|
||||||
password2: Any = ...
|
password2: Any = ...
|
||||||
user: django.contrib.auth.models.User = ...
|
user: django.contrib.auth.models.User = ...
|
||||||
def __init__(
|
def __init__(self, user: AbstractUser, *args: Any, **kwargs: Any) -> None: ...
|
||||||
self, user: AbstractUser, *args: Any, **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
def clean_password2(self) -> str: ...
|
def clean_password2(self) -> str: ...
|
||||||
def save(self, commit: bool = ...) -> AbstractUser: ...
|
def save(self, commit: bool = ...) -> AbstractUser: ...
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -2,7 +2,5 @@ from typing import Any, Dict, Optional
|
|||||||
|
|
||||||
UserModel: Any
|
UserModel: Any
|
||||||
|
|
||||||
def check_password(
|
def check_password(environ: Dict[Any, Any], username: str, password: str) -> Any: ...
|
||||||
environ: Dict[Any, Any], username: str, password: str
|
|
||||||
) -> Any: ...
|
|
||||||
def groups_for_user(environ: Dict[Any, Any], username: str) -> Any: ...
|
def groups_for_user(environ: Dict[Any, Any], username: str) -> Any: ...
|
||||||
|
|||||||
@@ -5,15 +5,8 @@ UNUSABLE_PASSWORD_PREFIX: str
|
|||||||
UNUSABLE_PASSWORD_SUFFIX_LENGTH: int
|
UNUSABLE_PASSWORD_SUFFIX_LENGTH: int
|
||||||
|
|
||||||
def is_password_usable(encoded: Optional[str]) -> bool: ...
|
def is_password_usable(encoded: Optional[str]) -> bool: ...
|
||||||
def check_password(
|
def check_password(password: Optional[str], encoded: str, setter: Optional[Callable] = ..., preferred: str = ...) -> bool: ...
|
||||||
password: Optional[str],
|
def make_password(password: Optional[str], salt: Optional[str] = ..., hasher: str = ...) -> str: ...
|
||||||
encoded: str,
|
|
||||||
setter: Optional[Callable] = ...,
|
|
||||||
preferred: str = ...,
|
|
||||||
) -> bool: ...
|
|
||||||
def make_password(
|
|
||||||
password: Optional[str], salt: Optional[str] = ..., hasher: str = ...
|
|
||||||
) -> str: ...
|
|
||||||
def get_hashers() -> List[BasePasswordHasher]: ...
|
def get_hashers() -> List[BasePasswordHasher]: ...
|
||||||
def get_hashers_by_algorithm() -> Dict[str, BasePasswordHasher]: ...
|
def get_hashers_by_algorithm() -> Dict[str, BasePasswordHasher]: ...
|
||||||
def reset_hashers(**kwargs: Any) -> None: ...
|
def reset_hashers(**kwargs: Any) -> None: ...
|
||||||
@@ -35,9 +28,7 @@ class PBKDF2PasswordHasher(BasePasswordHasher):
|
|||||||
algorithm: str = ...
|
algorithm: str = ...
|
||||||
iterations: int = ...
|
iterations: int = ...
|
||||||
digest: Any = ...
|
digest: Any = ...
|
||||||
def encode(
|
def encode(self, password: str, salt: str, iterations: Optional[int] = ...) -> str: ...
|
||||||
self, password: str, salt: str, iterations: Optional[int] = ...
|
|
||||||
) -> str: ...
|
|
||||||
def verify(self, password: str, encoded: str) -> bool: ...
|
def verify(self, password: str, encoded: str) -> bool: ...
|
||||||
def safe_summary(self, encoded: str) -> OrderedDict: ...
|
def safe_summary(self, encoded: str) -> OrderedDict: ...
|
||||||
def must_update(self, encoded: str) -> bool: ...
|
def must_update(self, encoded: str) -> bool: ...
|
||||||
|
|||||||
@@ -3,14 +3,8 @@ from typing import Any, Optional
|
|||||||
from django.apps.config import AppConfig
|
from django.apps.config import AppConfig
|
||||||
from django.apps.registry import Apps
|
from django.apps.registry import Apps
|
||||||
|
|
||||||
|
|
||||||
def create_permissions(
|
def create_permissions(
|
||||||
app_config: AppConfig,
|
app_config: AppConfig, verbosity: int = ..., interactive: bool = ..., using: str = ..., apps: Apps = ..., **kwargs: Any
|
||||||
verbosity: int = ...,
|
|
||||||
interactive: bool = ...,
|
|
||||||
using: str = ...,
|
|
||||||
apps: Apps = ...,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_system_username() -> str: ...
|
def get_system_username() -> str: ...
|
||||||
def get_default_username(check_db: bool = ...) -> str: ...
|
def get_default_username(check_db: bool = ...) -> str: ...
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from typing import Any, Optional, Union
|
|||||||
from django.core.management.base import BaseCommand, CommandParser
|
from django.core.management.base import BaseCommand, CommandParser
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import Field
|
||||||
|
|
||||||
|
|
||||||
class NotRunningInTTYException(Exception): ...
|
class NotRunningInTTYException(Exception): ...
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
@@ -20,6 +19,4 @@ class Command(BaseCommand):
|
|||||||
stdin: Any = ...
|
stdin: Any = ...
|
||||||
def execute(self, *args: Any, **options: Any) -> None: ...
|
def execute(self, *args: Any, **options: Any) -> None: ...
|
||||||
def handle(self, *args: Any, **options: Any) -> None: ...
|
def handle(self, *args: Any, **options: Any) -> None: ...
|
||||||
def get_input_data(
|
def get_input_data(self, field: Field, message: str, default: Optional[str] = ...) -> Optional[Union[int, str]]: ...
|
||||||
self, field: Field, message: str, default: Optional[str] = ...
|
|
||||||
) -> Optional[Union[int, str]]: ...
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from django.core.handlers.wsgi import WSGIRequest
|
|||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
from django.utils.deprecation import MiddlewareMixin
|
from django.utils.deprecation import MiddlewareMixin
|
||||||
|
|
||||||
|
|
||||||
def get_user(request: WSGIRequest) -> Union[AnonymousUser, User]: ...
|
def get_user(request: WSGIRequest) -> Union[AnonymousUser, User]: ...
|
||||||
|
|
||||||
class AuthenticationMiddleware(MiddlewareMixin):
|
class AuthenticationMiddleware(MiddlewareMixin):
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from typing import Any, Callable, List, Optional
|
|||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||||
|
|
||||||
|
|
||||||
class AccessMixin:
|
class AccessMixin:
|
||||||
login_url: Any = ...
|
login_url: Any = ...
|
||||||
permission_denied_message: str = ...
|
permission_denied_message: str = ...
|
||||||
@@ -15,21 +14,15 @@ class AccessMixin:
|
|||||||
def handle_no_permission(self) -> HttpResponseRedirect: ...
|
def handle_no_permission(self) -> HttpResponseRedirect: ...
|
||||||
|
|
||||||
class LoginRequiredMixin(AccessMixin):
|
class LoginRequiredMixin(AccessMixin):
|
||||||
def dispatch(
|
def dispatch(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
|
|
||||||
class PermissionRequiredMixin(AccessMixin):
|
class PermissionRequiredMixin(AccessMixin):
|
||||||
permission_required: Any = ...
|
permission_required: Any = ...
|
||||||
def get_permission_required(self) -> List[str]: ...
|
def get_permission_required(self) -> List[str]: ...
|
||||||
def has_permission(self) -> bool: ...
|
def has_permission(self) -> bool: ...
|
||||||
def dispatch(
|
def dispatch(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
|
|
||||||
class UserPassesTestMixin(AccessMixin):
|
class UserPassesTestMixin(AccessMixin):
|
||||||
def test_func(self) -> None: ...
|
def test_func(self) -> None: ...
|
||||||
def get_test_func(self) -> Callable: ...
|
def get_test_func(self) -> Callable: ...
|
||||||
def dispatch(
|
def dispatch(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
|
|||||||
@@ -6,19 +6,14 @@ from django.db.models.manager import EmptyManager
|
|||||||
|
|
||||||
from .validators import UnicodeUsernameValidator
|
from .validators import UnicodeUsernameValidator
|
||||||
|
|
||||||
|
def update_last_login(sender: Type[AbstractBaseUser], user: AbstractBaseUser, **kwargs: Any) -> None: ...
|
||||||
def update_last_login(
|
|
||||||
sender: Type[AbstractBaseUser], user: AbstractBaseUser, **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
|
|
||||||
class PermissionManager(models.Manager):
|
class PermissionManager(models.Manager):
|
||||||
creation_counter: int
|
creation_counter: int
|
||||||
model: None
|
model: None
|
||||||
name: None
|
name: None
|
||||||
use_in_migrations: bool = ...
|
use_in_migrations: bool = ...
|
||||||
def get_by_natural_key(
|
def get_by_natural_key(self, codename: str, app_label: str, model: str) -> Permission: ...
|
||||||
self, codename: str, app_label: str, model: str
|
|
||||||
) -> Permission: ...
|
|
||||||
|
|
||||||
class Permission(models.Model):
|
class Permission(models.Model):
|
||||||
content_type_id: int
|
content_type_id: int
|
||||||
@@ -57,18 +52,10 @@ class UserManager(BaseUserManager):
|
|||||||
name: None
|
name: None
|
||||||
use_in_migrations: bool = ...
|
use_in_migrations: bool = ...
|
||||||
def create_user(
|
def create_user(
|
||||||
self,
|
self, username: str, email: Optional[str] = ..., password: Optional[str] = ..., **extra_fields: Any
|
||||||
username: str,
|
|
||||||
email: Optional[str] = ...,
|
|
||||||
password: Optional[str] = ...,
|
|
||||||
**extra_fields: Any
|
|
||||||
) -> AbstractUser: ...
|
) -> AbstractUser: ...
|
||||||
def create_superuser(
|
def create_superuser(
|
||||||
self,
|
self, username: str, email: Optional[str], password: Optional[str], **extra_fields: Any
|
||||||
username: str,
|
|
||||||
email: Optional[str],
|
|
||||||
password: Optional[str],
|
|
||||||
**extra_fields: Any
|
|
||||||
) -> AbstractBaseUser: ...
|
) -> AbstractBaseUser: ...
|
||||||
|
|
||||||
class PermissionsMixin(models.Model):
|
class PermissionsMixin(models.Model):
|
||||||
@@ -79,12 +66,8 @@ class PermissionsMixin(models.Model):
|
|||||||
abstract: bool = ...
|
abstract: bool = ...
|
||||||
def get_group_permissions(self, obj: None = ...) -> Set[str]: ...
|
def get_group_permissions(self, obj: None = ...) -> Set[str]: ...
|
||||||
def get_all_permissions(self, obj: Optional[str] = ...) -> Set[str]: ...
|
def get_all_permissions(self, obj: Optional[str] = ...) -> Set[str]: ...
|
||||||
def has_perm(
|
def has_perm(self, perm: Union[Tuple[str, Any], str], obj: Optional[str] = ...) -> bool: ...
|
||||||
self, perm: Union[Tuple[str, Any], str], obj: Optional[str] = ...
|
def has_perms(self, perm_list: Union[List[str], Set[str], Tuple[str]], obj: None = ...) -> bool: ...
|
||||||
) -> bool: ...
|
|
||||||
def has_perms(
|
|
||||||
self, perm_list: Union[List[str], Set[str], Tuple[str]], obj: None = ...
|
|
||||||
) -> bool: ...
|
|
||||||
def has_module_perms(self, app_label: str) -> bool: ...
|
def has_module_perms(self, app_label: str) -> bool: ...
|
||||||
|
|
||||||
class AbstractUser(AbstractBaseUser, PermissionsMixin):
|
class AbstractUser(AbstractBaseUser, PermissionsMixin):
|
||||||
@@ -110,9 +93,7 @@ class AbstractUser(AbstractBaseUser, PermissionsMixin):
|
|||||||
def clean(self) -> None: ...
|
def clean(self) -> None: ...
|
||||||
def get_full_name(self) -> str: ...
|
def get_full_name(self) -> str: ...
|
||||||
def get_short_name(self) -> str: ...
|
def get_short_name(self) -> str: ...
|
||||||
def email_user(
|
def email_user(self, subject: str, message: str, from_email: str = ..., **kwargs: Any) -> None: ...
|
||||||
self, subject: str, message: str, from_email: str = ..., **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
|
|
||||||
class User(AbstractUser):
|
class User(AbstractUser):
|
||||||
date_joined: datetime.datetime
|
date_joined: datetime.datetime
|
||||||
@@ -149,9 +130,7 @@ class AnonymousUser:
|
|||||||
def get_group_permissions(self, obj: None = ...) -> Set[Any]: ...
|
def get_group_permissions(self, obj: None = ...) -> Set[Any]: ...
|
||||||
def get_all_permissions(self, obj: Any = ...) -> Set[str]: ...
|
def get_all_permissions(self, obj: Any = ...) -> Set[str]: ...
|
||||||
def has_perm(self, perm: str, obj: None = ...) -> bool: ...
|
def has_perm(self, perm: str, obj: None = ...) -> bool: ...
|
||||||
def has_perms(
|
def has_perms(self, perm_list: Union[List[str], Tuple[str]], obj: None = ...) -> bool: ...
|
||||||
self, perm_list: Union[List[str], Tuple[str]], obj: None = ...
|
|
||||||
) -> bool: ...
|
|
||||||
def has_module_perms(self, module: str) -> bool: ...
|
def has_module_perms(self, module: str) -> bool: ...
|
||||||
@property
|
@property
|
||||||
def is_anonymous(self) -> bool: ...
|
def is_anonymous(self) -> bool: ...
|
||||||
|
|||||||
@@ -4,28 +4,15 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|||||||
from django.contrib.auth.base_user import AbstractBaseUser
|
from django.contrib.auth.base_user import AbstractBaseUser
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
def get_default_password_validators() -> Union[List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]]: ...
|
||||||
def get_default_password_validators() -> Union[
|
|
||||||
List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]
|
|
||||||
]: ...
|
|
||||||
def get_password_validators(
|
def get_password_validators(
|
||||||
validator_config: List[Dict[str, Union[Dict[str, int], str]]]
|
validator_config: List[Dict[str, Union[Dict[str, int], str]]]
|
||||||
) -> Union[
|
) -> Union[List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]]: ...
|
||||||
List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]
|
|
||||||
]: ...
|
|
||||||
def validate_password(
|
def validate_password(
|
||||||
password: str,
|
password: str, user: Optional[AbstractBaseUser] = ..., password_validators: Optional[List[Any]] = ...
|
||||||
user: Optional[AbstractBaseUser] = ...,
|
|
||||||
password_validators: Optional[List[Any]] = ...,
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def password_changed(
|
def password_changed(password: str, user: Optional[AbstractBaseUser] = ..., password_validators: None = ...) -> None: ...
|
||||||
password: str,
|
def password_validators_help_texts(password_validators: Optional[List[Any]] = ...) -> List[str]: ...
|
||||||
user: Optional[AbstractBaseUser] = ...,
|
|
||||||
password_validators: None = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def password_validators_help_texts(
|
|
||||||
password_validators: Optional[List[Any]] = ...
|
|
||||||
) -> List[str]: ...
|
|
||||||
|
|
||||||
password_validators_help_text_html: Any
|
password_validators_help_text_html: Any
|
||||||
|
|
||||||
@@ -40,9 +27,7 @@ class UserAttributeSimilarityValidator:
|
|||||||
user_attributes: Tuple[str, str, str, str] = ...
|
user_attributes: Tuple[str, str, str, str] = ...
|
||||||
max_similarity: float = ...
|
max_similarity: float = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, user_attributes: Union[List[str], Tuple[str, str, str, str]] = ..., max_similarity: float = ...
|
||||||
user_attributes: Union[List[str], Tuple[str, str, str, str]] = ...,
|
|
||||||
max_similarity: float = ...,
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def validate(self, password: str, user: Optional[User] = ...) -> None: ...
|
def validate(self, password: str, user: Optional[User] = ...) -> None: ...
|
||||||
def get_help_text(self) -> str: ...
|
def get_help_text(self) -> str: ...
|
||||||
@@ -50,14 +35,10 @@ class UserAttributeSimilarityValidator:
|
|||||||
class CommonPasswordValidator:
|
class CommonPasswordValidator:
|
||||||
DEFAULT_PASSWORD_LIST_PATH: Any = ...
|
DEFAULT_PASSWORD_LIST_PATH: Any = ...
|
||||||
passwords: Set[str] = ...
|
passwords: Set[str] = ...
|
||||||
def __init__(
|
def __init__(self, password_list_path: Union[PosixPath, str] = ...) -> None: ...
|
||||||
self, password_list_path: Union[PosixPath, str] = ...
|
|
||||||
) -> None: ...
|
|
||||||
def validate(self, password: str, user: None = ...) -> None: ...
|
def validate(self, password: str, user: None = ...) -> None: ...
|
||||||
def get_help_text(self) -> str: ...
|
def get_help_text(self) -> str: ...
|
||||||
|
|
||||||
class NumericPasswordValidator:
|
class NumericPasswordValidator:
|
||||||
def validate(
|
def validate(self, password: str, user: Optional[AbstractBaseUser] = ...) -> None: ...
|
||||||
self, password: str, user: Optional[AbstractBaseUser] = ...
|
|
||||||
) -> None: ...
|
|
||||||
def get_help_text(self) -> str: ...
|
def get_help_text(self) -> str: ...
|
||||||
|
|||||||
@@ -2,13 +2,10 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from django.contrib.auth.base_user import AbstractBaseUser
|
from django.contrib.auth.base_user import AbstractBaseUser
|
||||||
|
|
||||||
|
|
||||||
class PasswordResetTokenGenerator:
|
class PasswordResetTokenGenerator:
|
||||||
key_salt: str = ...
|
key_salt: str = ...
|
||||||
secret: Any = ...
|
secret: Any = ...
|
||||||
def make_token(self, user: AbstractBaseUser) -> str: ...
|
def make_token(self, user: AbstractBaseUser) -> str: ...
|
||||||
def check_token(
|
def check_token(self, user: Optional[AbstractBaseUser], token: Optional[str]) -> bool: ...
|
||||||
self, user: Optional[AbstractBaseUser], token: Optional[str]
|
|
||||||
) -> bool: ...
|
|
||||||
|
|
||||||
default_token_generator: Any
|
default_token_generator: Any
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
from typing import Any, Dict, Optional, Set, Type, Union
|
from typing import Any, Dict, Optional, Set, Type, Union
|
||||||
|
|
||||||
from django.contrib.auth.base_user import AbstractBaseUser
|
from django.contrib.auth.base_user import AbstractBaseUser
|
||||||
from django.contrib.auth.forms import (AuthenticationForm, PasswordChangeForm,
|
from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm, PasswordResetForm, SetPasswordForm
|
||||||
PasswordResetForm, SetPasswordForm)
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.contrib.sites.models import Site
|
from django.contrib.sites.models import Site
|
||||||
from django.contrib.sites.requests import RequestSite
|
from django.contrib.sites.requests import RequestSite
|
||||||
@@ -27,45 +26,27 @@ class LoginView(SuccessURLAllowedHostsMixin, FormView):
|
|||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
redirect_authenticated_user: bool = ...
|
redirect_authenticated_user: bool = ...
|
||||||
extra_context: Any = ...
|
extra_context: Any = ...
|
||||||
def dispatch(
|
def dispatch(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
def get_success_url(self) -> str: ...
|
def get_success_url(self) -> str: ...
|
||||||
def get_redirect_url(self) -> str: ...
|
def get_redirect_url(self) -> str: ...
|
||||||
def get_form_class(self) -> Type[AuthenticationForm]: ...
|
def get_form_class(self) -> Type[AuthenticationForm]: ...
|
||||||
def get_form_kwargs(
|
def get_form_kwargs(self) -> Dict[str, Optional[Union[Dict[str, str], HttpRequest, MultiValueDict]]]: ...
|
||||||
self
|
|
||||||
) -> Dict[
|
|
||||||
str, Optional[Union[Dict[str, str], HttpRequest, MultiValueDict]]
|
|
||||||
]: ...
|
|
||||||
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
||||||
def get_context_data(
|
def get_context_data(self, **kwargs: Any) -> Dict[str, Union[AuthenticationForm, LoginView, Site, RequestSite, str]]: ...
|
||||||
self, **kwargs: Any
|
|
||||||
) -> Dict[
|
|
||||||
str, Union[AuthenticationForm, LoginView, Site, RequestSite, str]
|
|
||||||
]: ...
|
|
||||||
|
|
||||||
class LogoutView(SuccessURLAllowedHostsMixin, TemplateView):
|
class LogoutView(SuccessURLAllowedHostsMixin, TemplateView):
|
||||||
next_page: Any = ...
|
next_page: Any = ...
|
||||||
redirect_field_name: Any = ...
|
redirect_field_name: Any = ...
|
||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
extra_context: Any = ...
|
extra_context: Any = ...
|
||||||
def dispatch(
|
def dispatch(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
def post(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> TemplateResponse: ...
|
||||||
) -> HttpResponse: ...
|
|
||||||
def post(
|
|
||||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
|
||||||
) -> TemplateResponse: ...
|
|
||||||
def get_next_page(self) -> Optional[str]: ...
|
def get_next_page(self) -> Optional[str]: ...
|
||||||
def get_context_data(self, **kwargs: Any): ...
|
def get_context_data(self, **kwargs: Any): ...
|
||||||
|
|
||||||
def logout_then_login(
|
def logout_then_login(request: HttpRequest, login_url: Optional[str] = ...) -> HttpResponseRedirect: ...
|
||||||
request: HttpRequest, login_url: Optional[str] = ...
|
|
||||||
) -> HttpResponseRedirect: ...
|
|
||||||
def redirect_to_login(
|
def redirect_to_login(
|
||||||
next: str,
|
next: str, login_url: Optional[str] = ..., redirect_field_name: Optional[str] = ...
|
||||||
login_url: Optional[str] = ...,
|
|
||||||
redirect_field_name: Optional[str] = ...,
|
|
||||||
) -> HttpResponseRedirect: ...
|
) -> HttpResponseRedirect: ...
|
||||||
|
|
||||||
class PasswordContextMixin:
|
class PasswordContextMixin:
|
||||||
@@ -105,11 +86,7 @@ class PasswordResetConfirmView(PasswordContextMixin, FormView):
|
|||||||
user: Any = ...
|
user: Any = ...
|
||||||
def dispatch(self, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
def dispatch(self, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||||
def get_user(self, uidb64: str) -> Optional[AbstractBaseUser]: ...
|
def get_user(self, uidb64: str) -> Optional[AbstractBaseUser]: ...
|
||||||
def get_form_kwargs(
|
def get_form_kwargs(self) -> Dict[str, Optional[Union[Dict[Any, Any], AbstractBaseUser, MultiValueDict]]]: ...
|
||||||
self
|
|
||||||
) -> Dict[
|
|
||||||
str, Optional[Union[Dict[Any, Any], AbstractBaseUser, MultiValueDict]]
|
|
||||||
]: ...
|
|
||||||
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
|
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
|
||||||
def get_context_data(self, **kwargs: Any): ...
|
def get_context_data(self, **kwargs: Any): ...
|
||||||
|
|
||||||
@@ -124,9 +101,7 @@ class PasswordChangeView(PasswordContextMixin, FormView):
|
|||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
title: Any = ...
|
title: Any = ...
|
||||||
def dispatch(self, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
def dispatch(self, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||||
def get_form_kwargs(
|
def get_form_kwargs(self) -> Dict[str, Optional[Union[Dict[Any, Any], User, MultiValueDict]]]: ...
|
||||||
self
|
|
||||||
) -> Dict[str, Optional[Union[Dict[Any, Any], User, MultiValueDict]]]: ...
|
|
||||||
def form_valid(self, form: PasswordChangeForm) -> HttpResponseRedirect: ...
|
def form_valid(self, form: PasswordChangeForm) -> HttpResponseRedirect: ...
|
||||||
|
|
||||||
class PasswordChangeDoneView(PasswordContextMixin, TemplateView):
|
class PasswordChangeDoneView(PasswordContextMixin, TemplateView):
|
||||||
|
|||||||
@@ -2,9 +2,5 @@ from django.db.models.base import Model
|
|||||||
from typing import Any, List, Type
|
from typing import Any, List, Type
|
||||||
|
|
||||||
class GenericInlineModelAdminChecks:
|
class GenericInlineModelAdminChecks:
|
||||||
def _check_exclude_of_parent_model(
|
def _check_exclude_of_parent_model(self, obj: GenericTabularInline, parent_model: Type[Model]) -> List[Any]: ...
|
||||||
self, obj: GenericTabularInline, parent_model: Type[Model]
|
def _check_relation(self, obj: GenericTabularInline, parent_model: Type[Model]) -> List[Any]: ...
|
||||||
) -> List[Any]: ...
|
|
||||||
def _check_relation(
|
|
||||||
self, obj: GenericTabularInline, parent_model: Type[Model]
|
|
||||||
) -> List[Any]: ...
|
|
||||||
|
|||||||
@@ -2,9 +2,7 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
from .management import (create_contenttypes,
|
from .management import create_contenttypes, inject_rename_contenttypes_operations
|
||||||
inject_rename_contenttypes_operations)
|
|
||||||
|
|
||||||
|
|
||||||
class ContentTypesConfig(AppConfig):
|
class ContentTypesConfig(AppConfig):
|
||||||
apps: None
|
apps: None
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
from typing import Any, List, Optional
|
from typing import Any, List, Optional
|
||||||
|
|
||||||
|
def check_generic_foreign_keys(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||||
def check_generic_foreign_keys(
|
def check_model_name_lengths(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||||
app_configs: None = ..., **kwargs: Any
|
|
||||||
) -> List[Any]: ...
|
|
||||||
def check_model_name_lengths(
|
|
||||||
app_configs: None = ..., **kwargs: Any
|
|
||||||
) -> List[Any]: ...
|
|
||||||
|
|||||||
@@ -5,13 +5,11 @@ from django.core.checks.messages import Error
|
|||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.fields import Field, PositiveIntegerField
|
from django.db.models.fields import Field, PositiveIntegerField
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
from django.db.models.fields.mixins import FieldCacheMixin
|
||||||
from django.db.models.fields.related import (ForeignObject, ForeignObjectRel,
|
from django.db.models.fields.related import ForeignObject, ForeignObjectRel, ReverseManyToOneDescriptor
|
||||||
ReverseManyToOneDescriptor)
|
|
||||||
from django.db.models.query import QuerySet
|
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 django.db.models.sql.where import WhereNode
|
||||||
|
|
||||||
|
|
||||||
class GenericForeignKey(FieldCacheMixin):
|
class GenericForeignKey(FieldCacheMixin):
|
||||||
auto_created: bool = ...
|
auto_created: bool = ...
|
||||||
concrete: bool = ...
|
concrete: bool = ...
|
||||||
@@ -29,37 +27,21 @@ class GenericForeignKey(FieldCacheMixin):
|
|||||||
for_concrete_model: bool = ...
|
for_concrete_model: bool = ...
|
||||||
rel: None = ...
|
rel: None = ...
|
||||||
column: None = ...
|
column: None = ...
|
||||||
def __init__(
|
def __init__(self, ct_field: str = ..., fk_field: str = ..., for_concrete_model: bool = ...) -> None: ...
|
||||||
self,
|
|
||||||
ct_field: str = ...,
|
|
||||||
fk_field: str = ...,
|
|
||||||
for_concrete_model: bool = ...,
|
|
||||||
) -> None: ...
|
|
||||||
name: Any = ...
|
name: Any = ...
|
||||||
model: Any = ...
|
model: Any = ...
|
||||||
def contribute_to_class(
|
def contribute_to_class(self, cls: Type[Model], name: str, **kwargs: Any) -> None: ...
|
||||||
self, cls: Type[Model], name: str, **kwargs: Any
|
def get_filter_kwargs_for_object(self, obj: Model) -> Dict[str, Optional[ContentType]]: ...
|
||||||
) -> None: ...
|
|
||||||
def get_filter_kwargs_for_object(
|
|
||||||
self, obj: Model
|
|
||||||
) -> Dict[str, Optional[ContentType]]: ...
|
|
||||||
def get_forward_related_filter(self, obj: Model) -> Dict[str, int]: ...
|
def get_forward_related_filter(self, obj: Model) -> Dict[str, int]: ...
|
||||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||||
def get_cache_name(self) -> str: ...
|
def get_cache_name(self) -> str: ...
|
||||||
def get_content_type(
|
def get_content_type(
|
||||||
self,
|
self, obj: Optional[Model] = ..., id: Optional[int] = ..., using: Optional[str] = ...
|
||||||
obj: Optional[Model] = ...,
|
|
||||||
id: Optional[int] = ...,
|
|
||||||
using: Optional[str] = ...,
|
|
||||||
) -> ContentType: ...
|
) -> ContentType: ...
|
||||||
def get_prefetch_queryset(
|
def get_prefetch_queryset(
|
||||||
self,
|
self, instances: Union[List[Model], QuerySet], queryset: Optional[QuerySet] = ...
|
||||||
instances: Union[List[Model], QuerySet],
|
|
||||||
queryset: Optional[QuerySet] = ...,
|
|
||||||
) -> Tuple[List[Model], Callable, Callable, bool, str, bool]: ...
|
) -> Tuple[List[Model], Callable, Callable, bool, str, bool]: ...
|
||||||
def __get__(
|
def __get__(self, instance: Optional[Model], cls: Type[Model] = ...) -> Optional[Union[GenericForeignKey, Model]]: ...
|
||||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
|
||||||
) -> Optional[Union[GenericForeignKey, Model]]: ...
|
|
||||||
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
|
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
|
||||||
|
|
||||||
class GenericRel(ForeignObjectRel):
|
class GenericRel(ForeignObjectRel):
|
||||||
@@ -104,32 +86,17 @@ class GenericRelation(ForeignObject):
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||||
to_fields: Any = ...
|
to_fields: Any = ...
|
||||||
def resolve_related_fields(
|
def resolve_related_fields(self) -> List[Tuple[PositiveIntegerField, Field]]: ...
|
||||||
self
|
def get_path_info(self, filtered_relation: Optional[FilteredRelation] = ...) -> List[PathInfo]: ...
|
||||||
) -> List[Tuple[PositiveIntegerField, Field]]: ...
|
def get_reverse_path_info(self, filtered_relation: None = ...) -> List[PathInfo]: ...
|
||||||
def get_path_info(
|
|
||||||
self, filtered_relation: Optional[FilteredRelation] = ...
|
|
||||||
) -> List[PathInfo]: ...
|
|
||||||
def get_reverse_path_info(
|
|
||||||
self, filtered_relation: None = ...
|
|
||||||
) -> List[PathInfo]: ...
|
|
||||||
def value_to_string(self, obj: Model) -> str: ...
|
def value_to_string(self, obj: Model) -> str: ...
|
||||||
model: Any = ...
|
model: Any = ...
|
||||||
def contribute_to_class(
|
def contribute_to_class(self, cls: Type[Model], name: str, **kwargs: Any) -> None: ...
|
||||||
self, cls: Type[Model], name: str, **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
def set_attributes_from_rel(self) -> None: ...
|
def set_attributes_from_rel(self) -> None: ...
|
||||||
def get_internal_type(self) -> str: ...
|
def get_internal_type(self) -> str: ...
|
||||||
def get_content_type(self) -> ContentType: ...
|
def get_content_type(self) -> ContentType: ...
|
||||||
def get_extra_restriction(
|
def get_extra_restriction(self, where_class: Type[WhereNode], alias: Optional[str], remote_alias: str) -> WhereNode: ...
|
||||||
self,
|
def bulk_related_objects(self, objs: List[Model], using: str = ...) -> QuerySet: ...
|
||||||
where_class: Type[WhereNode],
|
|
||||||
alias: Optional[str],
|
|
||||||
remote_alias: str,
|
|
||||||
) -> WhereNode: ...
|
|
||||||
def bulk_related_objects(
|
|
||||||
self, objs: List[Model], using: str = ...
|
|
||||||
) -> QuerySet: ...
|
|
||||||
|
|
||||||
class ReverseGenericManyToOneDescriptor(ReverseManyToOneDescriptor):
|
class ReverseGenericManyToOneDescriptor(ReverseManyToOneDescriptor):
|
||||||
field: django.contrib.contenttypes.fields.GenericRelation
|
field: django.contrib.contenttypes.fields.GenericRelation
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from django.forms.models import BaseModelFormSet
|
from django.forms.models import BaseModelFormSet
|
||||||
|
|
||||||
|
|
||||||
class BaseGenericInlineFormSet(BaseModelFormSet):
|
class BaseGenericInlineFormSet(BaseModelFormSet):
|
||||||
instance: Any = ...
|
instance: Any = ...
|
||||||
rel_name: Any = ...
|
rel_name: Any = ...
|
||||||
|
|||||||
@@ -9,35 +9,20 @@ from django.db.migrations.migration import Migration
|
|||||||
from django.db.migrations.state import StateApps
|
from django.db.migrations.state import StateApps
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
|
|
||||||
|
|
||||||
class RenameContentType(migrations.RunPython):
|
class RenameContentType(migrations.RunPython):
|
||||||
app_label: Any = ...
|
app_label: Any = ...
|
||||||
old_model: Any = ...
|
old_model: Any = ...
|
||||||
new_model: Any = ...
|
new_model: Any = ...
|
||||||
def __init__(
|
def __init__(self, app_label: str, old_model: str, new_model: str) -> None: ...
|
||||||
self, app_label: str, old_model: str, new_model: str
|
def rename_forward(self, apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: ...
|
||||||
) -> None: ...
|
def rename_backward(self, apps: StateApps, schema_editor: DatabaseSchemaEditor) -> 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(
|
def inject_rename_contenttypes_operations(
|
||||||
plan: List[Tuple[Migration, bool]] = ...,
|
plan: List[Tuple[Migration, bool]] = ..., apps: StateApps = ..., using: str = ..., **kwargs: Any
|
||||||
apps: StateApps = ...,
|
|
||||||
using: str = ...,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_contenttypes_and_models(
|
def get_contenttypes_and_models(
|
||||||
app_config: AppConfig, using: str, ContentType: Type[ContentType]
|
app_config: AppConfig, using: str, ContentType: Type[ContentType]
|
||||||
) -> Tuple[Dict[str, ContentType], Dict[str, Type[Model]]]: ...
|
) -> Tuple[Dict[str, ContentType], Dict[str, Type[Model]]]: ...
|
||||||
def create_contenttypes(
|
def create_contenttypes(
|
||||||
app_config: AppConfig,
|
app_config: AppConfig, verbosity: int = ..., interactive: bool = ..., using: str = ..., apps: Apps = ..., **kwargs: Any
|
||||||
verbosity: int = ...,
|
|
||||||
interactive: bool = ...,
|
|
||||||
using: str = ...,
|
|
||||||
apps: Apps = ...,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ from django.db.models.deletion import Collector
|
|||||||
|
|
||||||
from ...management import get_contenttypes_and_models
|
from ...management import get_contenttypes_and_models
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
stderr: django.core.management.base.OutputWrapper
|
stderr: django.core.management.base.OutputWrapper
|
||||||
stdout: django.core.management.base.OutputWrapper
|
stdout: django.core.management.base.OutputWrapper
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ from django.db import models
|
|||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
|
|
||||||
class ContentTypeManager(models.Manager):
|
class ContentTypeManager(models.Manager):
|
||||||
creation_counter: int
|
creation_counter: int
|
||||||
model: None
|
model: None
|
||||||
@@ -12,12 +11,8 @@ class ContentTypeManager(models.Manager):
|
|||||||
use_in_migrations: bool = ...
|
use_in_migrations: bool = ...
|
||||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||||
def get_by_natural_key(self, app_label: str, model: str) -> ContentType: ...
|
def get_by_natural_key(self, app_label: str, model: str) -> ContentType: ...
|
||||||
def get_for_model(
|
def get_for_model(self, model: Union[Type[Model], Model], for_concrete_model: bool = ...) -> ContentType: ...
|
||||||
self, model: Union[Type[Model], Model], for_concrete_model: bool = ...
|
def get_for_models(self, *models: Any, for_concrete_models: bool = ...) -> Dict[Type[Model], ContentType]: ...
|
||||||
) -> ContentType: ...
|
|
||||||
def get_for_models(
|
|
||||||
self, *models: Any, for_concrete_models: bool = ...
|
|
||||||
) -> Dict[Type[Model], ContentType]: ...
|
|
||||||
def get_for_id(self, id: int) -> ContentType: ...
|
def get_for_id(self, id: int) -> ContentType: ...
|
||||||
def clear_cache(self) -> None: ...
|
def clear_cache(self) -> None: ...
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,4 @@ from typing import Any, Optional, Union
|
|||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
from django.http.response import HttpResponseRedirect
|
from django.http.response import HttpResponseRedirect
|
||||||
|
|
||||||
|
def shortcut(request: HttpRequest, content_type_id: Union[int, str], object_id: Union[int, str]) -> HttpResponseRedirect: ...
|
||||||
def shortcut(
|
|
||||||
request: HttpRequest,
|
|
||||||
content_type_id: Union[int, str],
|
|
||||||
object_id: Union[int, str],
|
|
||||||
) -> HttpResponseRedirect: ...
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from typing import Any, Dict, Optional, Union
|
|||||||
from django import forms
|
from django import forms
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
|
|
||||||
class FlatpageForm(forms.ModelForm):
|
class FlatpageForm(forms.ModelForm):
|
||||||
auto_id: str
|
auto_id: str
|
||||||
data: Dict[str, Union[List[int], str]]
|
data: Dict[str, Union[List[int], str]]
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ from django.core.handlers.wsgi import WSGIRequest
|
|||||||
from django.http.response import HttpResponse
|
from django.http.response import HttpResponse
|
||||||
from django.utils.deprecation import MiddlewareMixin
|
from django.utils.deprecation import MiddlewareMixin
|
||||||
|
|
||||||
|
|
||||||
class FlatpageFallbackMiddleware(MiddlewareMixin):
|
class FlatpageFallbackMiddleware(MiddlewareMixin):
|
||||||
get_response: Callable
|
get_response: Callable
|
||||||
def process_response(
|
def process_response(self, request: WSGIRequest, response: HttpResponse) -> HttpResponse: ...
|
||||||
self, request: WSGIRequest, response: HttpResponse
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class FlatPage(models.Model):
|
class FlatPage(models.Model):
|
||||||
id: None
|
id: None
|
||||||
url: str = ...
|
url: str = ...
|
||||||
|
|||||||
@@ -3,6 +3,5 @@ from typing import Optional
|
|||||||
from django.contrib.sitemaps import Sitemap
|
from django.contrib.sitemaps import Sitemap
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
|
|
||||||
class FlatPageSitemap(Sitemap):
|
class FlatPageSitemap(Sitemap):
|
||||||
def items(self) -> QuerySet: ...
|
def items(self) -> QuerySet: ...
|
||||||
|
|||||||
@@ -10,12 +10,7 @@ class FlatpageNode(template.Node):
|
|||||||
context_name: str = ...
|
context_name: str = ...
|
||||||
starts_with: None = ...
|
starts_with: None = ...
|
||||||
user: None = ...
|
user: None = ...
|
||||||
def __init__(
|
def __init__(self, context_name: str, starts_with: Optional[str] = ..., user: Optional[str] = ...) -> None: ...
|
||||||
self,
|
|
||||||
context_name: str,
|
|
||||||
starts_with: Optional[str] = ...,
|
|
||||||
user: Optional[str] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def render(self, context: Context) -> str: ...
|
def render(self, context: Context) -> str: ...
|
||||||
|
|
||||||
def get_flatpages(parser: Parser, token: Token) -> FlatpageNode: ...
|
def get_flatpages(parser: Parser, token: Token) -> FlatpageNode: ...
|
||||||
|
|||||||
@@ -5,15 +5,11 @@ from typing import Any, Optional, Union
|
|||||||
register: Any
|
register: Any
|
||||||
|
|
||||||
def ordinal(value: Optional[str]) -> Optional[str]: ...
|
def ordinal(value: Optional[str]) -> Optional[str]: ...
|
||||||
def intcomma(
|
def intcomma(value: Optional[Union[Decimal, float, str]], use_l10n: bool = ...) -> str: ...
|
||||||
value: Optional[Union[Decimal, float, str]], use_l10n: bool = ...
|
|
||||||
) -> str: ...
|
|
||||||
|
|
||||||
intword_converters: Any
|
intword_converters: Any
|
||||||
|
|
||||||
def intword(value: Optional[str]) -> Optional[Union[int, str]]: ...
|
def intword(value: Optional[str]) -> Optional[Union[int, str]]: ...
|
||||||
def apnumber(value: Optional[str]) -> Optional[Union[int, str]]: ...
|
def apnumber(value: Optional[str]) -> Optional[Union[int, str]]: ...
|
||||||
def naturalday(
|
def naturalday(value: Optional[Union[date, str]], arg: None = ...) -> Optional[str]: ...
|
||||||
value: Optional[Union[date, str]], arg: None = ...
|
|
||||||
) -> Optional[str]: ...
|
|
||||||
def naturaltime(value: datetime) -> str: ...
|
def naturaltime(value: datetime) -> str: ...
|
||||||
|
|||||||
@@ -4,46 +4,16 @@ from django.contrib.messages.storage.base import BaseStorage
|
|||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
|
|
||||||
|
|
||||||
class MessageFailure(Exception): ...
|
class MessageFailure(Exception): ...
|
||||||
|
|
||||||
def add_message(
|
def add_message(
|
||||||
request: Optional[WSGIRequest],
|
request: Optional[WSGIRequest], level: int, message: str, extra_tags: str = ..., fail_silently: Union[bool, str] = ...
|
||||||
level: int,
|
|
||||||
message: str,
|
|
||||||
extra_tags: str = ...,
|
|
||||||
fail_silently: Union[bool, str] = ...,
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_messages(request: HttpRequest) -> Union[List[Any], BaseStorage]: ...
|
def get_messages(request: HttpRequest) -> Union[List[Any], BaseStorage]: ...
|
||||||
def get_level(request: HttpRequest) -> int: ...
|
def get_level(request: HttpRequest) -> int: ...
|
||||||
def set_level(request: HttpRequest, level: int) -> bool: ...
|
def set_level(request: HttpRequest, level: int) -> bool: ...
|
||||||
def debug(
|
def debug(request: WSGIRequest, message: str, extra_tags: str = ..., fail_silently: Union[bool, str] = ...) -> None: ...
|
||||||
request: WSGIRequest,
|
def info(request: WSGIRequest, message: str, extra_tags: str = ..., fail_silently: Union[bool, str] = ...) -> None: ...
|
||||||
message: str,
|
def success(request: WSGIRequest, message: str, extra_tags: str = ..., fail_silently: Union[bool, str] = ...) -> None: ...
|
||||||
extra_tags: str = ...,
|
def warning(request: WSGIRequest, message: str, extra_tags: str = ..., fail_silently: Union[bool, str] = ...) -> None: ...
|
||||||
fail_silently: Union[bool, str] = ...,
|
def error(request: WSGIRequest, message: str, extra_tags: str = ..., fail_silently: Union[bool, str] = ...) -> None: ...
|
||||||
) -> None: ...
|
|
||||||
def info(
|
|
||||||
request: WSGIRequest,
|
|
||||||
message: str,
|
|
||||||
extra_tags: str = ...,
|
|
||||||
fail_silently: Union[bool, str] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def success(
|
|
||||||
request: WSGIRequest,
|
|
||||||
message: str,
|
|
||||||
extra_tags: str = ...,
|
|
||||||
fail_silently: Union[bool, str] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def warning(
|
|
||||||
request: WSGIRequest,
|
|
||||||
message: str,
|
|
||||||
extra_tags: str = ...,
|
|
||||||
fail_silently: Union[bool, str] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def error(
|
|
||||||
request: WSGIRequest,
|
|
||||||
message: str,
|
|
||||||
extra_tags: str = ...,
|
|
||||||
fail_silently: Union[bool, str] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
|
|||||||
@@ -3,7 +3,4 @@ from typing import Any, Dict, List, Optional, Union
|
|||||||
from django.contrib.messages.storage.base import BaseStorage
|
from django.contrib.messages.storage.base import BaseStorage
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
|
|
||||||
|
def messages(request: HttpRequest) -> Dict[str, Union[Dict[str, int], List[Any], BaseStorage]]: ...
|
||||||
def messages(
|
|
||||||
request: HttpRequest
|
|
||||||
) -> Dict[str, Union[Dict[str, int], List[Any], BaseStorage]]: ...
|
|
||||||
|
|||||||
@@ -5,10 +5,7 @@ from django.http.request import HttpRequest
|
|||||||
from django.http.response import HttpResponseBase
|
from django.http.response import HttpResponseBase
|
||||||
from django.utils.deprecation import MiddlewareMixin
|
from django.utils.deprecation import MiddlewareMixin
|
||||||
|
|
||||||
|
|
||||||
class MessageMiddleware(MiddlewareMixin):
|
class MessageMiddleware(MiddlewareMixin):
|
||||||
get_response: Callable
|
get_response: Callable
|
||||||
def process_request(self, request: WSGIRequest) -> None: ...
|
def process_request(self, request: WSGIRequest) -> None: ...
|
||||||
def process_response(
|
def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ...
|
||||||
self, request: HttpRequest, response: HttpResponseBase
|
|
||||||
) -> HttpResponseBase: ...
|
|
||||||
|
|||||||
@@ -3,5 +3,4 @@ from typing import Any, Optional
|
|||||||
from django.contrib.messages.storage.base import BaseStorage
|
from django.contrib.messages.storage.base import BaseStorage
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
|
|
||||||
|
|
||||||
def default_storage(request: HttpRequest) -> BaseStorage: ...
|
def default_storage(request: HttpRequest) -> BaseStorage: ...
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ class Message:
|
|||||||
level: int = ...
|
level: int = ...
|
||||||
message: str = ...
|
message: str = ...
|
||||||
extra_tags: str = ...
|
extra_tags: str = ...
|
||||||
def __init__(
|
def __init__(self, level: int, message: str, extra_tags: Optional[str] = ...) -> None: ...
|
||||||
self, level: int, message: str, extra_tags: Optional[str] = ...
|
|
||||||
) -> None: ...
|
|
||||||
def __eq__(self, other: Union[Message, str]) -> bool: ...
|
def __eq__(self, other: Union[Message, str]) -> bool: ...
|
||||||
@property
|
@property
|
||||||
def tags(self) -> str: ...
|
def tags(self) -> str: ...
|
||||||
@@ -22,14 +20,10 @@ class BaseStorage:
|
|||||||
request: Any = ...
|
request: Any = ...
|
||||||
used: bool = ...
|
used: bool = ...
|
||||||
added_new: bool = ...
|
added_new: bool = ...
|
||||||
def __init__(
|
def __init__(self, request: HttpRequest, *args: Any, **kwargs: Any) -> None: ...
|
||||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
def __len__(self) -> int: ...
|
def __len__(self) -> int: ...
|
||||||
def __iter__(self): ...
|
def __iter__(self): ...
|
||||||
def __contains__(self, item: Any): ...
|
def __contains__(self, item: Any): ...
|
||||||
def update(self, response: HttpResponseBase) -> Optional[List[Message]]: ...
|
def update(self, response: HttpResponseBase) -> Optional[List[Message]]: ...
|
||||||
def add(
|
def add(self, level: int, message: str, extra_tags: Optional[str] = ...) -> None: ...
|
||||||
self, level: int, message: str, extra_tags: Optional[str] = ...
|
|
||||||
) -> None: ...
|
|
||||||
level: Any = ...
|
level: Any = ...
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from typing import Any, Dict, List, Optional, Union
|
|||||||
|
|
||||||
from django.contrib.messages.storage.base import BaseStorage, Message
|
from django.contrib.messages.storage.base import BaseStorage, Message
|
||||||
|
|
||||||
|
|
||||||
class MessageEncoder(json.JSONEncoder):
|
class MessageEncoder(json.JSONEncoder):
|
||||||
allow_nan: bool
|
allow_nan: bool
|
||||||
check_circular: bool
|
check_circular: bool
|
||||||
@@ -20,32 +19,13 @@ class MessageDecoder(json.JSONDecoder):
|
|||||||
def process_messages(
|
def process_messages(
|
||||||
self,
|
self,
|
||||||
obj: Union[
|
obj: Union[
|
||||||
Dict[
|
Dict[str, Union[List[Union[Dict[str, List[Union[int, str]]], List[Union[int, str]]]], List[Union[int, str]]]],
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, List[Union[int, str]]],
|
|
||||||
List[Union[int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[int, str]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
List[Union[List[Union[int, str]], str]],
|
List[Union[List[Union[int, str]], str]],
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
) -> Union[
|
) -> Union[
|
||||||
Dict[str, Union[List[Union[Dict[str, Message], Message]], Message]],
|
Dict[str, Union[List[Union[Dict[str, Message], Message]], Message]],
|
||||||
List[
|
List[Union[Dict[str, Union[List[Union[Dict[str, Message], Message]], Message]], Message]],
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[List[Union[Dict[str, Message], Message]], Message],
|
|
||||||
],
|
|
||||||
Message,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[Message, str]],
|
List[Union[Message, str]],
|
||||||
Message,
|
Message,
|
||||||
str,
|
str,
|
||||||
@@ -53,15 +33,7 @@ class MessageDecoder(json.JSONDecoder):
|
|||||||
def decode(
|
def decode(
|
||||||
self, s: str, **kwargs: Any
|
self, s: str, **kwargs: Any
|
||||||
) -> Union[
|
) -> Union[
|
||||||
List[
|
List[Union[Dict[str, Union[List[Union[Dict[str, Message], Message]], Message]], Message]],
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[List[Union[Dict[str, Message], Message]], Message],
|
|
||||||
],
|
|
||||||
Message,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[Message, str]],
|
List[Union[Message, str]],
|
||||||
Message,
|
Message,
|
||||||
]: ...
|
]: ...
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from django.contrib.messages.storage.base import BaseStorage
|
from django.contrib.messages.storage.base import BaseStorage
|
||||||
|
|
||||||
|
|
||||||
class FallbackStorage(BaseStorage):
|
class FallbackStorage(BaseStorage):
|
||||||
added_new: bool
|
added_new: bool
|
||||||
request: django.core.handlers.wsgi.WSGIRequest
|
request: django.core.handlers.wsgi.WSGIRequest
|
||||||
|
|||||||
@@ -3,18 +3,11 @@ from typing import Any, List, Optional, Union
|
|||||||
from django.contrib.messages.storage.base import BaseStorage, Message
|
from django.contrib.messages.storage.base import BaseStorage, Message
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
|
|
||||||
|
|
||||||
class SessionStorage(BaseStorage):
|
class SessionStorage(BaseStorage):
|
||||||
added_new: bool
|
added_new: bool
|
||||||
request: django.core.handlers.wsgi.WSGIRequest
|
request: django.core.handlers.wsgi.WSGIRequest
|
||||||
used: bool
|
used: bool
|
||||||
session_key: str = ...
|
session_key: str = ...
|
||||||
def __init__(
|
def __init__(self, request: HttpRequest, *args: Any, **kwargs: Any) -> None: ...
|
||||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
def serialize_messages(self, messages: Union[List[Message], List[str]]) -> str: ...
|
||||||
) -> None: ...
|
def deserialize_messages(self, data: Optional[Union[List[Any], str]]) -> Optional[Union[List[Message], List[str]]]: ...
|
||||||
def serialize_messages(
|
|
||||||
self, messages: Union[List[Message], List[str]]
|
|
||||||
) -> str: ...
|
|
||||||
def deserialize_messages(
|
|
||||||
self, data: Optional[Union[List[Any], str]]
|
|
||||||
) -> Optional[Union[List[Message], List[str]]]: ...
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
from typing import Dict, Optional
|
from typing import Dict, Optional
|
||||||
|
|
||||||
|
|
||||||
def get_level_tags() -> Dict[int, str]: ...
|
def get_level_tags() -> Dict[int, str]: ...
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from typing import Any, Dict, Optional
|
|||||||
from django.forms.forms import Form
|
from django.forms.forms import Form
|
||||||
from django.http.response import HttpResponseRedirect
|
from django.http.response import HttpResponseRedirect
|
||||||
|
|
||||||
|
|
||||||
class SuccessMessageMixin:
|
class SuccessMessageMixin:
|
||||||
success_message: str = ...
|
success_message: str = ...
|
||||||
def form_valid(self, form: Form) -> HttpResponseRedirect: ...
|
def form_valid(self, form: Form) -> HttpResponseRedirect: ...
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ from django.db.models.lookups import Exact, In
|
|||||||
|
|
||||||
from .mixins import CheckFieldDefaultMixin
|
from .mixins import CheckFieldDefaultMixin
|
||||||
|
|
||||||
_T = TypeVar('_T', bound=Field)
|
_T = TypeVar("_T", bound=Field)
|
||||||
|
|
||||||
|
|
||||||
class ArrayField(CheckFieldDefaultMixin, Field, Generic[_T]):
|
class ArrayField(CheckFieldDefaultMixin, Field, Generic[_T]):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
@@ -17,10 +16,7 @@ class ArrayField(CheckFieldDefaultMixin, Field, Generic[_T]):
|
|||||||
size: Any = ...
|
size: Any = ...
|
||||||
default_validators: Any = ...
|
default_validators: Any = ...
|
||||||
from_db_value: Any = ...
|
from_db_value: Any = ...
|
||||||
|
def __init__(self, base_field: Field, size: None = ..., **kwargs: Any) -> None: ...
|
||||||
def __init__(
|
|
||||||
self, base_field: Field, size: None = ..., **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
@property
|
@property
|
||||||
def model(self): ...
|
def model(self): ...
|
||||||
@model.setter
|
@model.setter
|
||||||
@@ -30,14 +26,8 @@ class ArrayField(CheckFieldDefaultMixin, Field, Generic[_T]):
|
|||||||
@property
|
@property
|
||||||
def description(self): ...
|
def description(self): ...
|
||||||
def db_type(self, connection: Any): ...
|
def db_type(self, connection: Any): ...
|
||||||
def get_db_prep_value(
|
def get_db_prep_value(self, value: Any, connection: Any, prepared: bool = ...): ...
|
||||||
self, value: Any, connection: Any, prepared: bool = ...
|
def deconstruct(self) -> Tuple[None, str, List[Any], Dict[str, Optional[Union[bool, Field]]]]: ...
|
||||||
): ...
|
|
||||||
def deconstruct(
|
|
||||||
self
|
|
||||||
) -> Tuple[
|
|
||||||
None, str, List[Any], Dict[str, Optional[Union[bool, Field]]]
|
|
||||||
]: ...
|
|
||||||
def to_python(self, value: Any): ...
|
def to_python(self, value: Any): ...
|
||||||
def value_to_string(self, obj: Any): ...
|
def value_to_string(self, obj: Any): ...
|
||||||
def get_transform(self, name: Any): ...
|
def get_transform(self, name: Any): ...
|
||||||
@@ -69,9 +59,7 @@ class ArrayInLookup(In):
|
|||||||
class IndexTransform(Transform):
|
class IndexTransform(Transform):
|
||||||
index: Any = ...
|
index: Any = ...
|
||||||
base_field: Any = ...
|
base_field: Any = ...
|
||||||
def __init__(
|
def __init__(self, index: Any, base_field: Any, *args: Any, **kwargs: Any) -> None: ...
|
||||||
self, index: Any, base_field: Any, *args: Any, **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
def as_sql(self, compiler: Any, connection: Any): ...
|
def as_sql(self, compiler: Any, connection: Any): ...
|
||||||
@property
|
@property
|
||||||
def output_field(self): ...
|
def output_field(self): ...
|
||||||
@@ -85,9 +73,7 @@ class IndexTransformFactory:
|
|||||||
class SliceTransform(Transform):
|
class SliceTransform(Transform):
|
||||||
start: Any = ...
|
start: Any = ...
|
||||||
end: Any = ...
|
end: Any = ...
|
||||||
def __init__(
|
def __init__(self, start: Any, end: Any, *args: Any, **kwargs: Any) -> None: ...
|
||||||
self, start: Any, end: Any, *args: Any, **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
def as_sql(self, compiler: Any, connection: Any): ...
|
def as_sql(self, compiler: Any, connection: Any): ...
|
||||||
|
|
||||||
class SliceTransformFactory:
|
class SliceTransformFactory:
|
||||||
|
|||||||
@@ -8,15 +8,9 @@ from django.db.models import lookups as builtin_lookups
|
|||||||
|
|
||||||
from .mixins import CheckFieldDefaultMixin
|
from .mixins import CheckFieldDefaultMixin
|
||||||
|
|
||||||
|
|
||||||
class JsonAdapter(Json):
|
class JsonAdapter(Json):
|
||||||
encoder: Any = ...
|
encoder: Any = ...
|
||||||
def __init__(
|
def __init__(self, adapted: Any, dumps: Optional[Any] = ..., encoder: Optional[Any] = ...) -> None: ...
|
||||||
self,
|
|
||||||
adapted: Any,
|
|
||||||
dumps: Optional[Any] = ...,
|
|
||||||
encoder: Optional[Any] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def dumps(self, obj: Any): ...
|
def dumps(self, obj: Any): ...
|
||||||
|
|
||||||
class JSONField(CheckFieldDefaultMixin, Field):
|
class JSONField(CheckFieldDefaultMixin, Field):
|
||||||
@@ -25,18 +19,10 @@ class JSONField(CheckFieldDefaultMixin, Field):
|
|||||||
default_error_messages: Any = ...
|
default_error_messages: Any = ...
|
||||||
encoder: Any = ...
|
encoder: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, verbose_name: None = ..., name: None = ..., encoder: Optional[Type[DjangoJSONEncoder]] = ..., **kwargs: Any
|
||||||
verbose_name: None = ...,
|
|
||||||
name: None = ...,
|
|
||||||
encoder: Optional[Type[DjangoJSONEncoder]] = ...,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def db_type(self, connection: Any): ...
|
def db_type(self, connection: Any): ...
|
||||||
def deconstruct(
|
def deconstruct(self) -> Tuple[None, str, List[Any], Dict[str, Union[Type[DjangoJSONEncoder], bool]]]: ...
|
||||||
self
|
|
||||||
) -> Tuple[
|
|
||||||
None, str, List[Any], Dict[str, Union[Type[DjangoJSONEncoder], bool]]
|
|
||||||
]: ...
|
|
||||||
def get_transform(self, name: Any): ...
|
def get_transform(self, name: Any): ...
|
||||||
def get_prep_value(self, value: Any): ...
|
def get_prep_value(self, value: Any): ...
|
||||||
def validate(self, value: Any, model_instance: Any) -> None: ...
|
def validate(self, value: Any, model_instance: Any) -> None: ...
|
||||||
@@ -56,32 +42,16 @@ class KeyTextTransform(KeyTransform):
|
|||||||
output_field: Any = ...
|
output_field: Any = ...
|
||||||
|
|
||||||
class KeyTransformTextLookupMixin:
|
class KeyTransformTextLookupMixin:
|
||||||
def __init__(
|
def __init__(self, key_transform: Any, *args: Any, **kwargs: Any) -> None: ...
|
||||||
self, key_transform: Any, *args: Any, **kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
|
|
||||||
class KeyTransformIExact(
|
class KeyTransformIExact(KeyTransformTextLookupMixin, builtin_lookups.IExact): ...
|
||||||
KeyTransformTextLookupMixin, builtin_lookups.IExact
|
class KeyTransformIContains(KeyTransformTextLookupMixin, builtin_lookups.IContains): ...
|
||||||
): ...
|
class KeyTransformStartsWith(KeyTransformTextLookupMixin, builtin_lookups.StartsWith): ...
|
||||||
class KeyTransformIContains(
|
class KeyTransformIStartsWith(KeyTransformTextLookupMixin, builtin_lookups.IStartsWith): ...
|
||||||
KeyTransformTextLookupMixin, builtin_lookups.IContains
|
class KeyTransformEndsWith(KeyTransformTextLookupMixin, builtin_lookups.EndsWith): ...
|
||||||
): ...
|
class KeyTransformIEndsWith(KeyTransformTextLookupMixin, builtin_lookups.IEndsWith): ...
|
||||||
class KeyTransformStartsWith(
|
|
||||||
KeyTransformTextLookupMixin, builtin_lookups.StartsWith
|
|
||||||
): ...
|
|
||||||
class KeyTransformIStartsWith(
|
|
||||||
KeyTransformTextLookupMixin, builtin_lookups.IStartsWith
|
|
||||||
): ...
|
|
||||||
class KeyTransformEndsWith(
|
|
||||||
KeyTransformTextLookupMixin, builtin_lookups.EndsWith
|
|
||||||
): ...
|
|
||||||
class KeyTransformIEndsWith(
|
|
||||||
KeyTransformTextLookupMixin, builtin_lookups.IEndsWith
|
|
||||||
): ...
|
|
||||||
class KeyTransformRegex(KeyTransformTextLookupMixin, builtin_lookups.Regex): ...
|
class KeyTransformRegex(KeyTransformTextLookupMixin, builtin_lookups.Regex): ...
|
||||||
class KeyTransformIRegex(
|
class KeyTransformIRegex(KeyTransformTextLookupMixin, builtin_lookups.IRegex): ...
|
||||||
KeyTransformTextLookupMixin, builtin_lookups.IRegex
|
|
||||||
): ...
|
|
||||||
|
|
||||||
class KeyTransformFactory:
|
class KeyTransformFactory:
|
||||||
key_name: Any = ...
|
key_name: Any = ...
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
from typing import Any, List, Optional
|
from typing import Any, List, Optional
|
||||||
|
|
||||||
|
|
||||||
class CheckFieldDefaultMixin:
|
class CheckFieldDefaultMixin:
|
||||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from typing import Any, Optional
|
|||||||
from django.contrib.postgres import lookups
|
from django.contrib.postgres import lookups
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class RangeField(models.Field):
|
class RangeField(models.Field):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
base_field: Any = ...
|
base_field: Any = ...
|
||||||
|
|||||||
@@ -4,22 +4,15 @@ from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
|||||||
from django.db.migrations.operations.base import Operation
|
from django.db.migrations.operations.base import Operation
|
||||||
from django.db.migrations.state import ProjectState
|
from django.db.migrations.state import ProjectState
|
||||||
|
|
||||||
|
|
||||||
class CreateExtension(Operation):
|
class CreateExtension(Operation):
|
||||||
reversible: bool = ...
|
reversible: bool = ...
|
||||||
name: Any = ...
|
name: Any = ...
|
||||||
def __init__(self, name: str) -> None: ...
|
def __init__(self, name: str) -> None: ...
|
||||||
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
|
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
|
||||||
def database_forwards(
|
def database_forwards(
|
||||||
self,
|
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
|
||||||
app_label: str,
|
|
||||||
schema_editor: DatabaseSchemaEditor,
|
|
||||||
from_state: ProjectState,
|
|
||||||
to_state: ProjectState,
|
|
||||||
) -> None: ...
|
|
||||||
def database_backwards(
|
|
||||||
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
|
||||||
def describe(self): ...
|
def describe(self): ...
|
||||||
|
|
||||||
class BtreeGinExtension(CreateExtension):
|
class BtreeGinExtension(CreateExtension):
|
||||||
|
|||||||
@@ -4,12 +4,9 @@ from django.core.handlers.wsgi import WSGIRequest
|
|||||||
from django.http.response import HttpResponse
|
from django.http.response import HttpResponse
|
||||||
from django.utils.deprecation import MiddlewareMixin
|
from django.utils.deprecation import MiddlewareMixin
|
||||||
|
|
||||||
|
|
||||||
class RedirectFallbackMiddleware(MiddlewareMixin):
|
class RedirectFallbackMiddleware(MiddlewareMixin):
|
||||||
get_response: Callable
|
get_response: Callable
|
||||||
response_gone_class: Any = ...
|
response_gone_class: Any = ...
|
||||||
response_redirect_class: Any = ...
|
response_redirect_class: Any = ...
|
||||||
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
||||||
def process_response(
|
def process_response(self, request: WSGIRequest, response: HttpResponse) -> HttpResponse: ...
|
||||||
self, request: WSGIRequest, response: HttpResponse
|
|
||||||
) -> HttpResponse: ...
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Redirect(models.Model):
|
class Redirect(models.Model):
|
||||||
id: None
|
id: None
|
||||||
site_id: int
|
site_id: int
|
||||||
|
|||||||
@@ -17,13 +17,9 @@ class SessionBase:
|
|||||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||||
def __contains__(self, key: str) -> bool: ...
|
def __contains__(self, key: str) -> bool: ...
|
||||||
def __getitem__(self, key: str) -> Union[Model, int, str]: ...
|
def __getitem__(self, key: str) -> Union[Model, int, str]: ...
|
||||||
def __setitem__(
|
def __setitem__(self, key: str, value: Union[datetime, Model, int, str]) -> None: ...
|
||||||
self, key: str, value: Union[datetime, Model, int, str]
|
|
||||||
) -> None: ...
|
|
||||||
def __delitem__(self, key: str) -> None: ...
|
def __delitem__(self, key: str) -> None: ...
|
||||||
def get(
|
def get(self, key: str, default: Optional[str] = ...) -> Optional[Union[datetime, int, str]]: ...
|
||||||
self, key: str, default: Optional[str] = ...
|
|
||||||
) -> Optional[Union[datetime, int, str]]: ...
|
|
||||||
def pop(self, key: str, default: Any = ...) -> Union[int, str]: ...
|
def pop(self, key: str, default: Any = ...) -> Union[int, str]: ...
|
||||||
def setdefault(self, key: str, value: str) -> str: ...
|
def setdefault(self, key: str, value: str) -> str: ...
|
||||||
def set_test_cookie(self) -> None: ...
|
def set_test_cookie(self) -> None: ...
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from django.contrib.sessions.base_session import AbstractBaseSession
|
|||||||
from django.contrib.sessions.models import Session
|
from django.contrib.sessions.models import Session
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
|
|
||||||
|
|
||||||
class SessionStore(SessionBase):
|
class SessionStore(SessionBase):
|
||||||
accessed: bool
|
accessed: bool
|
||||||
serializer: Type[django.core.signing.JSONSerializer]
|
serializer: Type[django.core.signing.JSONSerializer]
|
||||||
@@ -17,9 +16,7 @@ class SessionStore(SessionBase):
|
|||||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||||
modified: bool = ...
|
modified: bool = ...
|
||||||
def create(self) -> None: ...
|
def create(self) -> None: ...
|
||||||
def create_model_instance(
|
def create_model_instance(self, data: Dict[str, Model]) -> AbstractBaseSession: ...
|
||||||
self, data: Dict[str, Model]
|
|
||||||
) -> AbstractBaseSession: ...
|
|
||||||
def save(self, must_create: bool = ...) -> None: ...
|
def save(self, must_create: bool = ...) -> None: ...
|
||||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from typing import Any, Dict, Optional, Union
|
|||||||
|
|
||||||
from django.contrib.sessions.backends.base import SessionBase
|
from django.contrib.sessions.backends.base import SessionBase
|
||||||
|
|
||||||
|
|
||||||
class SessionStore(SessionBase):
|
class SessionStore(SessionBase):
|
||||||
accessed: bool
|
accessed: bool
|
||||||
serializer: Type[django.core.signing.JSONSerializer]
|
serializer: Type[django.core.signing.JSONSerializer]
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from typing import Any, Dict, Optional, Union
|
|||||||
|
|
||||||
from django.contrib.sessions.backends.base import SessionBase
|
from django.contrib.sessions.backends.base import SessionBase
|
||||||
|
|
||||||
|
|
||||||
class SessionStore(SessionBase):
|
class SessionStore(SessionBase):
|
||||||
accessed: bool
|
accessed: bool
|
||||||
serializer: Type[django.core.signing.JSONSerializer]
|
serializer: Type[django.core.signing.JSONSerializer]
|
||||||
|
|||||||
@@ -3,18 +3,12 @@ from typing import Any, Dict, Optional
|
|||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class BaseSessionManager(models.Manager):
|
class BaseSessionManager(models.Manager):
|
||||||
creation_counter: int
|
creation_counter: int
|
||||||
model: None
|
model: None
|
||||||
name: None
|
name: None
|
||||||
def encode(self, session_dict: Dict[str, int]) -> str: ...
|
def encode(self, session_dict: Dict[str, int]) -> str: ...
|
||||||
def save(
|
def save(self, session_key: str, session_dict: Dict[str, int], expire_date: datetime) -> AbstractBaseSession: ...
|
||||||
self,
|
|
||||||
session_key: str,
|
|
||||||
session_dict: Dict[str, int],
|
|
||||||
expire_date: datetime,
|
|
||||||
) -> AbstractBaseSession: ...
|
|
||||||
|
|
||||||
class AbstractBaseSession(models.Model):
|
class AbstractBaseSession(models.Model):
|
||||||
session_key: Any = ...
|
session_key: Any = ...
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
stderr: django.core.management.base.OutputWrapper
|
stderr: django.core.management.base.OutputWrapper
|
||||||
stdout: django.core.management.base.OutputWrapper
|
stdout: django.core.management.base.OutputWrapper
|
||||||
|
|||||||
@@ -6,15 +6,9 @@ from django.http.request import HttpRequest
|
|||||||
from django.http.response import HttpResponseBase
|
from django.http.response import HttpResponseBase
|
||||||
from django.utils.deprecation import MiddlewareMixin
|
from django.utils.deprecation import MiddlewareMixin
|
||||||
|
|
||||||
|
|
||||||
class SessionMiddleware(MiddlewareMixin):
|
class SessionMiddleware(MiddlewareMixin):
|
||||||
get_response: Callable[[WSGIRequest], HttpResponseBase] = ...
|
get_response: Callable[[WSGIRequest], HttpResponseBase] = ...
|
||||||
SessionStore: Type[SessionBase] = ...
|
SessionStore: Type[SessionBase] = ...
|
||||||
|
|
||||||
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
||||||
|
|
||||||
def process_request(self, request: HttpRequest) -> None: ...
|
def process_request(self, request: HttpRequest) -> None: ...
|
||||||
|
def process_response(self, request: WSGIRequest, response: HttpResponseBase) -> HttpResponseBase: ...
|
||||||
def process_response(
|
|
||||||
self, request: WSGIRequest, response: HttpResponseBase
|
|
||||||
) -> HttpResponseBase: ...
|
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
from typing import Any, Optional, Type
|
from typing import Any, Optional, Type
|
||||||
|
|
||||||
from django.contrib.sessions.backends.db import SessionStore
|
from django.contrib.sessions.backends.db import SessionStore
|
||||||
from django.contrib.sessions.base_session import (AbstractBaseSession,
|
from django.contrib.sessions.base_session import AbstractBaseSession, BaseSessionManager
|
||||||
BaseSessionManager)
|
|
||||||
|
|
||||||
|
|
||||||
class SessionManager(BaseSessionManager):
|
class SessionManager(BaseSessionManager):
|
||||||
creation_counter: int
|
creation_counter: int
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from typing import Any, Dict, Optional
|
|||||||
from django.core.signing import JSONSerializer as BaseJSONSerializer
|
from django.core.signing import JSONSerializer as BaseJSONSerializer
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
|
|
||||||
|
|
||||||
class PickleSerializer:
|
class PickleSerializer:
|
||||||
def dumps(self, obj: Dict[str, Model]) -> bytes: ...
|
def dumps(self, obj: Dict[str, Model]) -> bytes: ...
|
||||||
def loads(self, data: bytes) -> Dict[str, Model]: ...
|
def loads(self, data: bytes) -> Dict[str, Model]: ...
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ class Sitemap:
|
|||||||
@property
|
@property
|
||||||
def paginator(self) -> Paginator: ...
|
def paginator(self) -> Paginator: ...
|
||||||
def get_urls(
|
def get_urls(
|
||||||
self,
|
self, page: Union[int, str] = ..., site: Optional[Union[Site, RequestSite]] = ..., protocol: Optional[str] = ...
|
||||||
page: Union[int, str] = ...,
|
|
||||||
site: Optional[Union[Site, RequestSite]] = ...,
|
|
||||||
protocol: Optional[str] = ...,
|
|
||||||
) -> List[Dict[str, Optional[Union[datetime, Model, str]]]]: ...
|
) -> List[Dict[str, Optional[Union[datetime, Model, str]]]]: ...
|
||||||
|
|
||||||
class GenericSitemap(Sitemap):
|
class GenericSitemap(Sitemap):
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from django.core.management.base import BaseCommand, CommandParser
|
from django.core.management.base import BaseCommand, CommandParser
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
stderr: django.core.management.base.OutputWrapper
|
stderr: django.core.management.base.OutputWrapper
|
||||||
stdout: django.core.management.base.OutputWrapper
|
stdout: django.core.management.base.OutputWrapper
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from django.contrib.sitemaps import GenericSitemap, Sitemap
|
|||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
|
|
||||||
|
|
||||||
def x_robots_tag(func: Callable) -> Callable: ...
|
def x_robots_tag(func: Callable) -> Callable: ...
|
||||||
def index(
|
def index(
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
@@ -16,9 +15,7 @@ def index(
|
|||||||
) -> TemplateResponse: ...
|
) -> TemplateResponse: ...
|
||||||
def sitemap(
|
def sitemap(
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
sitemaps: Union[
|
sitemaps: Union[Dict[str, Type[Sitemap]], Dict[str, GenericSitemap], OrderedDict],
|
||||||
Dict[str, Type[Sitemap]], Dict[str, GenericSitemap], OrderedDict
|
|
||||||
],
|
|
||||||
section: Optional[str] = ...,
|
section: Optional[str] = ...,
|
||||||
template_name: str = ...,
|
template_name: str = ...,
|
||||||
content_type: str = ...,
|
content_type: str = ...,
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ from django.apps import AppConfig
|
|||||||
|
|
||||||
from .management import create_default_site
|
from .management import create_default_site
|
||||||
|
|
||||||
|
|
||||||
class SitesConfig(AppConfig):
|
class SitesConfig(AppConfig):
|
||||||
apps: None
|
apps: None
|
||||||
label: str
|
label: str
|
||||||
|
|||||||
@@ -3,12 +3,6 @@ from typing import Any, Optional
|
|||||||
from django.apps.registry import Apps
|
from django.apps.registry import Apps
|
||||||
from django.contrib.sites.apps import SitesConfig
|
from django.contrib.sites.apps import SitesConfig
|
||||||
|
|
||||||
|
|
||||||
def create_default_site(
|
def create_default_site(
|
||||||
app_config: SitesConfig,
|
app_config: SitesConfig, verbosity: int = ..., interactive: bool = ..., using: str = ..., apps: Apps = ..., **kwargs: Any
|
||||||
verbosity: int = ...,
|
|
||||||
interactive: bool = ...,
|
|
||||||
using: str = ...,
|
|
||||||
apps: Apps = ...,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ from django.core.checks.messages import Error
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
|
|
||||||
class CurrentSiteManager(models.Manager):
|
class CurrentSiteManager(models.Manager):
|
||||||
creation_counter: int
|
creation_counter: int
|
||||||
model: None
|
model: None
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from django.utils.deprecation import MiddlewareMixin
|
|||||||
|
|
||||||
from .shortcuts import get_current_site
|
from .shortcuts import get_current_site
|
||||||
|
|
||||||
|
|
||||||
class CurrentSiteMiddleware(MiddlewareMixin):
|
class CurrentSiteMiddleware(MiddlewareMixin):
|
||||||
get_response: None
|
get_response: None
|
||||||
def process_request(self, request: HttpRequest) -> None: ...
|
def process_request(self, request: HttpRequest) -> None: ...
|
||||||
|
|||||||
@@ -2,12 +2,9 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
|
|
||||||
|
|
||||||
class RequestSite:
|
class RequestSite:
|
||||||
name: str
|
name: str
|
||||||
domain: str = ...
|
domain: str = ...
|
||||||
def __init__(self, request: HttpRequest) -> None: ...
|
def __init__(self, request: HttpRequest) -> None: ...
|
||||||
def save(
|
def save(self, force_insert: bool = ..., force_update: bool = ...) -> Any: ...
|
||||||
self, force_insert: bool = ..., force_update: bool = ...
|
|
||||||
) -> Any: ...
|
|
||||||
def delete(self) -> Any: ...
|
def delete(self) -> Any: ...
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user