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