mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-19 18:31:15 +08:00
fifth iteration
This commit is contained in:
@@ -48,7 +48,7 @@ class FieldListFilter(ListFilter):
|
||||
title: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: Union[Field, ForeignObjectRel],
|
||||
field: Union[Field, reverse_related.ForeignObjectRel],
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
@@ -63,21 +63,13 @@ class FieldListFilter(ListFilter):
|
||||
def register(
|
||||
cls,
|
||||
test: Callable,
|
||||
list_filter_class: Type[
|
||||
Union[
|
||||
AllValuesFieldListFilter,
|
||||
BooleanFieldListFilter,
|
||||
ChoicesFieldListFilter,
|
||||
DateFieldListFilter,
|
||||
RelatedFieldListFilter,
|
||||
]
|
||||
],
|
||||
list_filter_class: Type[FieldListFilter],
|
||||
take_priority: bool = ...,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def create(
|
||||
cls,
|
||||
field: Union[Field, ForeignObjectRel],
|
||||
field: Union[Field, reverse_related.ForeignObjectRel],
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
@@ -115,7 +107,7 @@ class RelatedFieldListFilter(FieldListFilter):
|
||||
field: FieldCacheMixin,
|
||||
request: WSGIRequest,
|
||||
model_admin: ModelAdmin,
|
||||
) -> List[Tuple[str, str]]: ...
|
||||
) -> List[Tuple[Union[int, str], str]]: ...
|
||||
def choices(self, changelist: Any) -> None: ...
|
||||
|
||||
class BooleanFieldListFilter(FieldListFilter):
|
||||
@@ -209,4 +201,4 @@ class RelatedOnlyFieldListFilter(RelatedFieldListFilter):
|
||||
used_parameters: Dict[Any, Any]
|
||||
def field_choices(
|
||||
self, field: RelatedField, request: WSGIRequest, model_admin: ModelAdmin
|
||||
) -> List[Tuple[str, str]]: ...
|
||||
) -> List[Tuple[Union[int, str], str]]: ...
|
||||
|
||||
@@ -135,12 +135,7 @@ class InlineAdminFormSet:
|
||||
def __iter__(self) -> Iterator[InlineAdminForm]: ...
|
||||
def fields(
|
||||
self
|
||||
) -> Iterator[
|
||||
Union[
|
||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
||||
Dict[str, Union[bool, Widget, str]],
|
||||
]
|
||||
]: ...
|
||||
) -> Iterator[Dict[str, Union[Dict[str, bool], bool, Widget, str]]]: ...
|
||||
def inline_formset_data(self) -> str: ...
|
||||
@property
|
||||
def forms(self): ...
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from django.contrib.admin.filters import SimpleListFilter
|
||||
from django.contrib.admin.models import LogEntry
|
||||
from django.contrib.admin.sites import AdminSite, DefaultAdminSite
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.contrib.admin.views.main import ChangeList
|
||||
from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
@@ -87,20 +87,9 @@ class BaseModelAdmin:
|
||||
def get_fieldsets(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> Union[
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
Union[
|
||||
Dict[str, List[Any]],
|
||||
Dict[str, List[Union[Callable, str]]],
|
||||
Dict[str, List[str]],
|
||||
Dict[str, Tuple[str, str]],
|
||||
],
|
||||
]
|
||||
],
|
||||
Tuple[Tuple[None, Dict[str, Tuple[Tuple[str, str]]]]],
|
||||
List[Tuple[None, Dict[str, List[Union[Callable, str]]]]],
|
||||
Tuple[
|
||||
Tuple[str, Dict[str, Tuple[str]]], Tuple[str, Dict[str, Tuple[str]]]
|
||||
Tuple[Optional[str], Dict[str, Tuple[Union[Tuple[str, str], str]]]]
|
||||
],
|
||||
]: ...
|
||||
def get_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
||||
@@ -130,7 +119,12 @@ class BaseModelAdmin:
|
||||
|
||||
class ModelAdmin(BaseModelAdmin):
|
||||
formfield_overrides: Dict[
|
||||
Type[Any],
|
||||
Type[
|
||||
Union[
|
||||
django.db.models.fields.DateTimeCheckMixin,
|
||||
django.db.models.fields.Field,
|
||||
]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
@@ -173,9 +167,7 @@ class ModelAdmin(BaseModelAdmin):
|
||||
opts: django.db.models.options.Options = ...
|
||||
admin_site: django.contrib.admin.sites.AdminSite = ...
|
||||
def __init__(
|
||||
self,
|
||||
model: Type[Model],
|
||||
admin_site: Optional[Union[AdminSite, DefaultAdminSite]],
|
||||
self, model: Type[Model], admin_site: Optional[AdminSite]
|
||||
) -> None: ...
|
||||
def get_inline_instances(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
|
||||
@@ -17,10 +17,7 @@ DOT: str
|
||||
def paginator_number(cl: ChangeList, i: int) -> SafeText: ...
|
||||
def pagination(
|
||||
cl: ChangeList
|
||||
) -> Union[
|
||||
Dict[str, Union[List[Union[int, str]], ChangeList, int, str]],
|
||||
Dict[str, Union[ChangeList, int, range, str]],
|
||||
]: ...
|
||||
) -> Dict[str, Union[List[Union[int, str]], ChangeList, int, range, str]]: ...
|
||||
def pagination_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def result_headers(
|
||||
cl: ChangeList
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
from datetime import date, datetime
|
||||
from datetime import datetime
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.contrib.admin.options import BaseModelAdmin
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
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 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): ...
|
||||
@@ -34,30 +35,9 @@ def flatten(
|
||||
) -> List[Union[Callable, str]]: ...
|
||||
def flatten_fieldsets(
|
||||
fieldsets: Union[
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
Union[
|
||||
Dict[str, List[Any]],
|
||||
Dict[str, List[Union[Callable, str]]],
|
||||
Dict[str, List[str]],
|
||||
Dict[str, Tuple[str, str]],
|
||||
],
|
||||
]
|
||||
],
|
||||
List[Tuple[str, Dict[str, Tuple[str]]]],
|
||||
List[Tuple[Optional[str], Dict[str, Tuple[str]]]],
|
||||
Tuple[
|
||||
Union[
|
||||
Tuple[Dict[str, Tuple[str]], Dict[str, Tuple[str]]],
|
||||
Tuple[
|
||||
None,
|
||||
Union[
|
||||
Dict[str, Tuple[Tuple[str, str]]],
|
||||
Dict[str, Tuple[str, str, List[str]]],
|
||||
Dict[str, Tuple[str, str, Tuple[str, str]]],
|
||||
],
|
||||
],
|
||||
]
|
||||
Tuple[Optional[str], Dict[str, Tuple[Union[Tuple[str, str], str]]]]
|
||||
],
|
||||
]
|
||||
) -> List[Union[Callable, str]]: ...
|
||||
@@ -88,10 +68,7 @@ class NestedObjects(Collector):
|
||||
) -> QuerySet: ...
|
||||
def nested(
|
||||
self, format_callback: Callable = ...
|
||||
) -> Union[
|
||||
List[Union[List[Union[List[int], int]], int]],
|
||||
List[Union[List[Union[List[str], str]], str]],
|
||||
]: ...
|
||||
) -> Union[List[SafeText], List[int]]: ...
|
||||
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ...
|
||||
|
||||
def model_format_dict(obj: Any): ...
|
||||
@@ -100,27 +77,18 @@ def model_ngettext(
|
||||
) -> str: ...
|
||||
def lookup_field(
|
||||
name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ...
|
||||
) -> Union[
|
||||
Tuple[None, Callable, Optional[Callable]],
|
||||
Tuple[None, Union[date, Model, int, str], Union[date, Model, int, str]],
|
||||
Tuple[Field, None, Any],
|
||||
]: ...
|
||||
) -> Tuple[Optional[Field], Callable, Callable]: ...
|
||||
def label_for_field(
|
||||
name: Union[Callable, str],
|
||||
model: Type[Model],
|
||||
model_admin: Optional[BaseModelAdmin] = ...,
|
||||
return_attr: bool = ...,
|
||||
) -> Union[
|
||||
Tuple[
|
||||
Optional[Union[Callable, GenericForeignKey]],
|
||||
Optional[Union[Callable, GenericForeignKey]],
|
||||
],
|
||||
Tuple[str, Type[str]],
|
||||
str,
|
||||
]: ...
|
||||
) -> 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, OneToOneRel], empty_value_display: str
|
||||
value: Any,
|
||||
field: Union[Field, reverse_related.OneToOneRel],
|
||||
empty_value_display: str,
|
||||
) -> str: ...
|
||||
def display_for_value(
|
||||
value: Any, empty_value_display: str, boolean: bool = ...
|
||||
@@ -129,14 +97,14 @@ def display_for_value(
|
||||
class NotRelationField(Exception): ...
|
||||
|
||||
def get_model_from_relation(
|
||||
field: Union[Field, mixins.FieldCacheMixin]
|
||||
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, mixins.FieldCacheMixin]]: ...
|
||||
) -> List[Union[Field, FieldCacheMixin]]: ...
|
||||
def construct_change_message(
|
||||
form: AdminPasswordChangeForm, formsets: None, add: bool
|
||||
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||
|
||||
@@ -64,12 +64,10 @@ class ChangeList:
|
||||
def get_filters_params(self, params: None = ...) -> Dict[str, str]: ...
|
||||
def get_filters(
|
||||
self, request: WSGIRequest
|
||||
) -> Tuple[List[ListFilter], bool, bool, bool]: ...
|
||||
) -> Tuple[List[ListFilter], bool, Dict[str, Union[bool, str]], bool]: ...
|
||||
def get_query_string(
|
||||
self,
|
||||
new_params: Optional[
|
||||
Union[Dict[str, None], Dict[str, Union[int, str]]]
|
||||
] = ...,
|
||||
new_params: Optional[Dict[str, None]] = ...,
|
||||
remove: Optional[List[str]] = ...,
|
||||
) -> str: ...
|
||||
result_count: Any = ...
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from collections import OrderedDict
|
||||
from datetime import datetime
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django import forms
|
||||
from django.contrib.admin.sites import AdminSite, DefaultAdminSite
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||
from django.db.models.query_utils import Q
|
||||
from django.forms.fields import Field
|
||||
@@ -30,9 +30,9 @@ class FilteredSelectMultiple(forms.SelectMultiple):
|
||||
name: str,
|
||||
value: Union[List[Any], str],
|
||||
attrs: Optional[Dict[str, str]],
|
||||
) -> Union[
|
||||
Dict[
|
||||
str,
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
@@ -48,9 +48,6 @@ class FilteredSelectMultiple(forms.SelectMultiple):
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[str, Union[Dict[str, Union[int, str]], List[str], bool, str]],
|
||||
],
|
||||
]: ...
|
||||
@@ -87,106 +84,30 @@ class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
||||
name: str,
|
||||
value: Optional[Union[List[str], datetime]],
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
) -> Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
bool,
|
||||
str,
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
]
|
||||
],
|
||||
],
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[Union[Dict[str, str], bool, str]],
|
||||
]
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
]
|
||||
],
|
||||
],
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, Union[bool, str]], bool, str],
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]], bool, str
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
str,
|
||||
],
|
||||
],
|
||||
]: ...
|
||||
|
||||
@@ -203,7 +124,8 @@ def url_params_from_lookup_dict(
|
||||
Dict[str, Callable],
|
||||
Dict[str, List[str]],
|
||||
Dict[str, Tuple[str, str]],
|
||||
Dict[str, Union[int, str]],
|
||||
Dict[str, bool],
|
||||
Dict[str, str],
|
||||
Q,
|
||||
]
|
||||
) -> Dict[str, str]: ...
|
||||
@@ -217,7 +139,7 @@ class ForeignKeyRawIdWidget(forms.TextInput):
|
||||
def __init__(
|
||||
self,
|
||||
rel: ForeignObjectRel,
|
||||
admin_site: Union[AdminSite, DefaultAdminSite],
|
||||
admin_site: AdminSite,
|
||||
attrs: None = ...,
|
||||
using: None = ...,
|
||||
) -> None: ...
|
||||
@@ -226,18 +148,12 @@ class ForeignKeyRawIdWidget(forms.TextInput):
|
||||
name: str,
|
||||
value: Optional[Union[List[int], int, str, UUID]],
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
) -> Union[
|
||||
Dict[
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Optional[Union[Dict[str, Union[bool, str]], bool, str]]],
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str, Optional[Union[Dict[str, Union[bool, str]], bool, str]]
|
||||
],
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Dict[str, Union[Dict[Any, Any], bool, str]], str]],
|
||||
Dict[str, Union[Dict[str, Union[Dict[str, str], bool, str]], str]],
|
||||
]: ...
|
||||
def base_url_parameters(self) -> Dict[str, str]: ...
|
||||
def url_parameters(self) -> Dict[str, str]: ...
|
||||
@@ -256,10 +172,7 @@ class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
|
||||
name: str,
|
||||
value: Optional[List[int]],
|
||||
attrs: Optional[Dict[str, str]],
|
||||
) -> Union[
|
||||
Dict[str, Union[Dict[str, Union[Dict[Any, Any], bool, str]], str]],
|
||||
Dict[str, Union[Dict[str, Union[Dict[str, str], bool, str]], str]],
|
||||
]: ...
|
||||
) -> Dict[str, Union[Dict[str, Union[Dict[str, str], bool, str]], str]]: ...
|
||||
def url_parameters(self) -> Dict[Any, Any]: ...
|
||||
def label_and_url_for_value(self, value: List[int]) -> Tuple[str, str]: ...
|
||||
def value_from_datadict(
|
||||
@@ -283,7 +196,7 @@ class RelatedFieldWidgetWrapper(forms.Widget):
|
||||
self,
|
||||
widget: ChoiceWidget,
|
||||
rel: ForeignObjectRel,
|
||||
admin_site: Union[AdminSite, DefaultAdminSite],
|
||||
admin_site: AdminSite,
|
||||
can_add_related: Optional[bool] = ...,
|
||||
can_change_related: bool = ...,
|
||||
can_delete_related: bool = ...,
|
||||
@@ -362,7 +275,7 @@ class AutocompleteMixin:
|
||||
def __init__(
|
||||
self,
|
||||
rel: ForeignObjectRel,
|
||||
admin_site: Union[AdminSite, DefaultAdminSite],
|
||||
admin_site: AdminSite,
|
||||
attrs: Optional[Dict[str, str]] = ...,
|
||||
choices: Tuple = ...,
|
||||
using: None = ...,
|
||||
@@ -378,7 +291,13 @@ class AutocompleteMixin:
|
||||
name: str,
|
||||
value: List[str],
|
||||
attr: Dict[str, Union[bool, str]] = ...,
|
||||
) -> List[Tuple[None, int, int]]: ...
|
||||
) -> List[
|
||||
Tuple[
|
||||
None,
|
||||
List[Dict[str, Union[Dict[str, bool], Set[str], int, str]]],
|
||||
int,
|
||||
]
|
||||
]: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
|
||||
|
||||
@@ -14,7 +14,12 @@ sensitive_post_parameters_m: Any
|
||||
class GroupAdmin(admin.ModelAdmin):
|
||||
admin_site: django.contrib.admin.sites.AdminSite
|
||||
formfield_overrides: Dict[
|
||||
Type[Any],
|
||||
Type[
|
||||
Union[
|
||||
django.db.models.fields.DateTimeCheckMixin,
|
||||
django.db.models.fields.Field,
|
||||
]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
@@ -40,7 +45,12 @@ class GroupAdmin(admin.ModelAdmin):
|
||||
class UserAdmin(admin.ModelAdmin):
|
||||
admin_site: django.contrib.admin.sites.AdminSite
|
||||
formfield_overrides: Dict[
|
||||
Type[Any],
|
||||
Type[
|
||||
Union[
|
||||
django.db.models.fields.DateTimeCheckMixin,
|
||||
django.db.models.fields.Field,
|
||||
]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
|
||||
@@ -22,7 +22,4 @@ class PermWrapper:
|
||||
|
||||
def auth(
|
||||
request: HttpRequest
|
||||
) -> Union[
|
||||
Dict[str, Union[PermWrapper, AnonymousUser]],
|
||||
Dict[str, Union[PermWrapper, User]],
|
||||
]: ...
|
||||
) -> Dict[str, Union[PermWrapper, AnonymousUser, User]]: ...
|
||||
|
||||
@@ -14,20 +14,11 @@ class ReadOnlyPasswordHashWidget(forms.Widget):
|
||||
template_name: str = ...
|
||||
def get_context(
|
||||
self, name: str, value: Optional[str], attrs: Dict[str, str]
|
||||
) -> Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Optional[Union[Dict[Any, Any], bool, str]]],
|
||||
List[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]],
|
||||
],
|
||||
]: ...
|
||||
|
||||
|
||||
@@ -6,16 +6,12 @@ from django.contrib.auth.models import User
|
||||
|
||||
|
||||
def get_default_password_validators() -> Union[
|
||||
List[Union[CommonPasswordValidator, MinimumLengthValidator]],
|
||||
List[Union[MinimumLengthValidator, UserAttributeSimilarityValidator]],
|
||||
List[NumericPasswordValidator],
|
||||
List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]
|
||||
]: ...
|
||||
def get_password_validators(
|
||||
validator_config: List[Dict[str, Union[Dict[str, int], str]]]
|
||||
) -> Union[
|
||||
List[Union[CommonPasswordValidator, MinimumLengthValidator]],
|
||||
List[Union[MinimumLengthValidator, UserAttributeSimilarityValidator]],
|
||||
List[NumericPasswordValidator],
|
||||
List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]
|
||||
]: ...
|
||||
def validate_password(
|
||||
password: str,
|
||||
|
||||
@@ -10,6 +10,7 @@ from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.views.generic.base import TemplateView
|
||||
from django.views.generic.edit import FormView
|
||||
|
||||
@@ -34,13 +35,14 @@ class LoginView(SuccessURLAllowedHostsMixin, FormView):
|
||||
def get_form_class(self) -> Type[AuthenticationForm]: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[str, Optional[Union[Dict[str, str], HttpRequest]]]: ...
|
||||
) -> Dict[
|
||||
str, Optional[Union[Dict[str, str], HttpRequest, MultiValueDict]]
|
||||
]: ...
|
||||
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
||||
def get_context_data(
|
||||
self, **kwargs: Any
|
||||
) -> Union[
|
||||
Dict[str, Union[AuthenticationForm, LoginView, Site, str]],
|
||||
Dict[str, Union[AuthenticationForm, LoginView, RequestSite, str]],
|
||||
) -> Dict[
|
||||
str, Union[AuthenticationForm, LoginView, Site, RequestSite, str]
|
||||
]: ...
|
||||
|
||||
class LogoutView(SuccessURLAllowedHostsMixin, TemplateView):
|
||||
@@ -105,7 +107,9 @@ class PasswordResetConfirmView(PasswordContextMixin, FormView):
|
||||
def get_user(self, uidb64: str) -> Optional[AbstractBaseUser]: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[str, Optional[Union[Dict[Any, Any], AbstractBaseUser]]]: ...
|
||||
) -> Dict[
|
||||
str, Optional[Union[Dict[Any, Any], AbstractBaseUser, MultiValueDict]]
|
||||
]: ...
|
||||
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
@@ -122,7 +126,7 @@ class PasswordChangeView(PasswordContextMixin, FormView):
|
||||
def dispatch(self, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[str, Optional[Union[Dict[Any, Any], User]]]: ...
|
||||
) -> Dict[str, Optional[Union[Dict[Any, Any], User, MultiValueDict]]]: ...
|
||||
def form_valid(self, form: PasswordChangeForm) -> HttpResponseRedirect: ...
|
||||
|
||||
class PasswordChangeDoneView(PasswordContextMixin, TemplateView):
|
||||
|
||||
@@ -42,9 +42,7 @@ class GenericForeignKey(FieldCacheMixin):
|
||||
) -> None: ...
|
||||
def get_filter_kwargs_for_object(
|
||||
self, obj: Model
|
||||
) -> Union[
|
||||
Dict[str, Optional[ContentType]], Dict[str, Union[ContentType, int]]
|
||||
]: ...
|
||||
) -> 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: ...
|
||||
|
||||
@@ -6,7 +6,4 @@ from django.http.request import HttpRequest
|
||||
|
||||
def messages(
|
||||
request: HttpRequest
|
||||
) -> Union[
|
||||
Dict[str, Union[Dict[str, int], List[Any]]],
|
||||
Dict[str, Union[Dict[str, int], BaseStorage]],
|
||||
]: ...
|
||||
) -> Dict[str, Union[Dict[str, int], List[Any], BaseStorage]]: ...
|
||||
|
||||
@@ -32,25 +32,7 @@ class MessageDecoder(json.JSONDecoder):
|
||||
List[Union[int, str]],
|
||||
],
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[
|
||||
Union[
|
||||
Dict[str, List[Union[int, str]]],
|
||||
List[Union[int, str]],
|
||||
]
|
||||
],
|
||||
List[Union[int, str]],
|
||||
],
|
||||
],
|
||||
List[Union[int, str]],
|
||||
]
|
||||
],
|
||||
List[Union[List[Union[int, str]], str]],
|
||||
List[Union[int, str]],
|
||||
str,
|
||||
],
|
||||
) -> Union[
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.contrib.postgres import lookups
|
||||
from django.contrib.postgres.fields.mixins import CheckFieldDefaultMixin
|
||||
from django.db.models import Field, Transform
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.lookups import Exact, In
|
||||
@@ -17,10 +16,7 @@ class ArrayField(CheckFieldDefaultMixin, Field):
|
||||
default_validators: Any = ...
|
||||
from_db_value: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
base_field: Union[CheckFieldDefaultMixin, Field],
|
||||
size: None = ...,
|
||||
**kwargs: Any
|
||||
self, base_field: Field, size: None = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
@property
|
||||
def model(self): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
@@ -29,21 +29,8 @@ class SessionBase:
|
||||
def set_test_cookie(self) -> None: ...
|
||||
def test_cookie_worked(self) -> bool: ...
|
||||
def delete_test_cookie(self) -> None: ...
|
||||
def encode(
|
||||
self,
|
||||
session_dict: Union[
|
||||
Dict[str, Union[datetime, str]],
|
||||
Dict[str, Union[int, str]],
|
||||
Dict[str, Model],
|
||||
],
|
||||
) -> str: ...
|
||||
def decode(
|
||||
self, session_data: Union[bytes, str]
|
||||
) -> Union[
|
||||
Dict[str, Union[datetime, str]],
|
||||
Dict[str, Union[int, str]],
|
||||
Dict[str, Model],
|
||||
]: ...
|
||||
def encode(self, session_dict: Dict[str, Model]) -> str: ...
|
||||
def decode(self, session_data: Union[bytes, str]) -> Dict[str, Model]: ...
|
||||
def update(self, dict_: Dict[str, int]) -> None: ...
|
||||
def has_key(self, key: Any): ...
|
||||
def keys(self): ...
|
||||
@@ -54,9 +41,7 @@ class SessionBase:
|
||||
session_key: Any = ...
|
||||
def get_expiry_age(self, **kwargs: Any) -> int: ...
|
||||
def get_expiry_date(self, **kwargs: Any) -> datetime: ...
|
||||
def set_expiry(
|
||||
self, value: Optional[Union[datetime, timedelta, int]]
|
||||
) -> None: ...
|
||||
def set_expiry(self, value: Optional[Union[datetime, int]]) -> None: ...
|
||||
def get_expire_at_browser_close(self) -> bool: ...
|
||||
def flush(self) -> None: ...
|
||||
def cycle_key(self) -> None: ...
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Optional, Type, Union
|
||||
|
||||
from django.contrib.sessions.backends.base import SessionBase
|
||||
@@ -14,19 +13,12 @@ class SessionStore(SessionBase):
|
||||
@classmethod
|
||||
def get_model_class(cls) -> Type[Session]: ...
|
||||
def model(self) -> Type[AbstractBaseSession]: ...
|
||||
def load(
|
||||
self
|
||||
) -> Union[Dict[str, Model], Dict[str, int], Dict[str, str]]: ...
|
||||
def load(self) -> Dict[str, Union[Model, int, str]]: ...
|
||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||
modified: bool = ...
|
||||
def create(self) -> None: ...
|
||||
def create_model_instance(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, Union[datetime, str]],
|
||||
Dict[str, Union[int, str]],
|
||||
Dict[str, Model],
|
||||
],
|
||||
self, data: Dict[str, Model]
|
||||
) -> AbstractBaseSession: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Optional, Union
|
||||
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: Union[Dict[str, Union[datetime, str]], Dict[str, Model]]
|
||||
) -> bytes: ...
|
||||
def loads(
|
||||
self, data: bytes
|
||||
) -> Union[Dict[str, Union[datetime, str]], Dict[str, Model]]: ...
|
||||
def dumps(self, obj: Dict[str, Model]) -> bytes: ...
|
||||
def loads(self, data: bytes) -> Dict[str, Model]: ...
|
||||
|
||||
JSONSerializer = BaseJSONSerializer
|
||||
|
||||
@@ -35,10 +35,7 @@ class GenericSitemap(Sitemap):
|
||||
protocol: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
info_dict: Union[
|
||||
Dict[str, Union[datetime, QuerySet]],
|
||||
Dict[str, Union[QuerySet, str]],
|
||||
],
|
||||
info_dict: Dict[str, Union[datetime, QuerySet, str]],
|
||||
priority: Optional[float] = ...,
|
||||
changefreq: Optional[str] = ...,
|
||||
protocol: Optional[str] = ...,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Callable, Dict, Optional, Type, Union
|
||||
|
||||
from django.contrib.sitemaps import GenericSitemap, Sitemap
|
||||
@@ -8,14 +9,16 @@ from django.template.response import TemplateResponse
|
||||
def x_robots_tag(func: Callable) -> Callable: ...
|
||||
def index(
|
||||
request: WSGIRequest,
|
||||
sitemaps: Union[Dict[str, Type[Sitemap]], Dict[str, Sitemap]],
|
||||
sitemaps: Dict[str, Union[Type[Sitemap], Sitemap]],
|
||||
template_name: str = ...,
|
||||
content_type: str = ...,
|
||||
sitemap_url_name: str = ...,
|
||||
) -> TemplateResponse: ...
|
||||
def sitemap(
|
||||
request: WSGIRequest,
|
||||
sitemaps: Union[Dict[str, Type[Sitemap]], Dict[str, GenericSitemap]],
|
||||
sitemaps: Union[
|
||||
Dict[str, Type[Sitemap]], Dict[str, GenericSitemap], OrderedDict
|
||||
],
|
||||
section: Optional[str] = ...,
|
||||
template_name: str = ...,
|
||||
content_type: str = ...,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from django.core.files.storage import DefaultStorage, FileSystemStorage
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.core.management.base import BaseCommand, CommandParser
|
||||
|
||||
|
||||
@@ -32,20 +32,11 @@ class Command(BaseCommand):
|
||||
def is_local_storage(self) -> bool: ...
|
||||
def clear_dir(self, path: str) -> None: ...
|
||||
def delete_file(
|
||||
self,
|
||||
path: str,
|
||||
prefixed_path: str,
|
||||
source_storage: Union[DefaultStorage, FileSystemStorage],
|
||||
self, path: str, prefixed_path: str, source_storage: FileSystemStorage
|
||||
) -> bool: ...
|
||||
def link_file(
|
||||
self,
|
||||
path: str,
|
||||
prefixed_path: str,
|
||||
source_storage: Union[DefaultStorage, FileSystemStorage],
|
||||
self, path: str, prefixed_path: str, source_storage: FileSystemStorage
|
||||
) -> None: ...
|
||||
def copy_file(
|
||||
self,
|
||||
path: str,
|
||||
prefixed_path: str,
|
||||
source_storage: Union[DefaultStorage, FileSystemStorage],
|
||||
self, path: str, prefixed_path: str, source_storage: FileSystemStorage
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django.core.files.storage import DefaultStorage, FileSystemStorage
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
|
||||
|
||||
def matches_patterns(
|
||||
path: str, patterns: Union[List[str], Tuple[str], OrderedDict] = ...
|
||||
) -> bool: ...
|
||||
def get_files(
|
||||
storage: Union[DefaultStorage, FileSystemStorage],
|
||||
storage: FileSystemStorage,
|
||||
ignore_patterns: List[str] = ...,
|
||||
location: str = ...,
|
||||
) -> Iterator[str]: ...
|
||||
|
||||
Reference in New Issue
Block a user