mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-07 12:44:29 +08:00
Merge pull request #10 from mkurnikov/master
Latest changes from Monkeytype fork
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
*.egg-info
|
*.egg-info
|
||||||
__pycache__/
|
__pycache__/
|
||||||
out/
|
out/
|
||||||
/test_sqlite.py
|
/test_sqlite.py
|
||||||
|
/django
|
||||||
2
django-stubs/apps/__init__.pyi
Normal file
2
django-stubs/apps/__init__.pyi
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
from .config import AppConfig as AppConfig
|
||||||
|
from .registry import apps as apps
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
from functools import partial
|
from typing import Any, Callable, List, Optional, Tuple, Type, Union
|
||||||
from typing import Any, List, Optional, Tuple, Type, Union
|
|
||||||
|
|
||||||
from django.apps.config import AppConfig
|
from django.apps.config import AppConfig
|
||||||
from django.db.migrations.state import AppConfigStub
|
from django.db.migrations.state import AppConfigStub
|
||||||
@@ -15,12 +14,15 @@ class Apps:
|
|||||||
apps_ready: bool = ...
|
apps_ready: bool = ...
|
||||||
loading: bool = ...
|
loading: bool = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self, installed_apps: Union[List[AppConfigStub], Tuple] = ...
|
self,
|
||||||
|
installed_apps: Optional[
|
||||||
|
Union[List[AppConfigStub], List[str], Tuple]
|
||||||
|
] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
models_ready: bool = ...
|
models_ready: bool = ...
|
||||||
ready: bool = ...
|
ready: bool = ...
|
||||||
def populate(
|
def populate(
|
||||||
self, installed_apps: Union[List[AppConfigStub], Tuple, List[str]] = ...
|
self, installed_apps: Union[List[AppConfigStub], List[str], Tuple] = ...
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def check_apps_ready(self) -> None: ...
|
def check_apps_ready(self) -> None: ...
|
||||||
def check_models_ready(self) -> None: ...
|
def check_models_ready(self) -> None: ...
|
||||||
@@ -36,7 +38,7 @@ class Apps:
|
|||||||
require_ready: bool = ...,
|
require_ready: bool = ...,
|
||||||
) -> Type[Model]: ...
|
) -> Type[Model]: ...
|
||||||
def register_model(self, app_label: str, model: Type[Model]) -> None: ...
|
def register_model(self, app_label: str, model: Type[Model]) -> None: ...
|
||||||
def is_installed(self, app_name: Any): ...
|
def is_installed(self, app_name: str) -> bool: ...
|
||||||
def get_containing_app_config(
|
def get_containing_app_config(
|
||||||
self, object_name: str
|
self, object_name: str
|
||||||
) -> Optional[AppConfig]: ...
|
) -> Optional[AppConfig]: ...
|
||||||
@@ -44,13 +46,15 @@ class Apps:
|
|||||||
self, app_label: str, model_name: str
|
self, app_label: str, model_name: str
|
||||||
) -> Type[Model]: ...
|
) -> Type[Model]: ...
|
||||||
def get_swappable_settings_name(self, to_string: str) -> Optional[str]: ...
|
def get_swappable_settings_name(self, to_string: str) -> Optional[str]: ...
|
||||||
def set_available_apps(self, available: Any) -> None: ...
|
def set_available_apps(self, available: List[str]) -> None: ...
|
||||||
def unset_available_apps(self) -> None: ...
|
def unset_available_apps(self) -> None: ...
|
||||||
def set_installed_apps(self, installed: List[str]) -> None: ...
|
def set_installed_apps(
|
||||||
|
self, installed: Union[List[str], Tuple[str]]
|
||||||
|
) -> None: ...
|
||||||
def unset_installed_apps(self) -> None: ...
|
def unset_installed_apps(self) -> None: ...
|
||||||
def clear_cache(self) -> None: ...
|
def clear_cache(self) -> None: ...
|
||||||
def lazy_model_operation(
|
def lazy_model_operation(
|
||||||
self, function: partial, *model_keys: Any
|
self, function: Callable, *model_keys: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def do_pending_operations(self, model: Type[Model]) -> None: ...
|
def do_pending_operations(self, model: Type[Model]) -> None: ...
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
from typing import Any, Callable, Optional, Tuple, Union
|
from collections import OrderedDict
|
||||||
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||||
|
|
||||||
|
from django.contrib.flatpages.sitemaps import FlatPageSitemap
|
||||||
|
from django.contrib.sitemaps import Sitemap
|
||||||
from django.urls import include as include
|
from django.urls import include as include
|
||||||
from django.urls.resolvers import URLPattern, URLResolver
|
from django.urls.resolvers import URLPattern, URLResolver
|
||||||
|
|
||||||
@@ -11,8 +14,19 @@ handler500: Any
|
|||||||
def url(
|
def url(
|
||||||
regex: str,
|
regex: str,
|
||||||
view: Optional[
|
view: Optional[
|
||||||
Union[Tuple[None, None, None], Tuple[str, str, str], Callable]
|
Union[
|
||||||
|
Callable,
|
||||||
|
Tuple[List[Union[URLPattern, URLResolver]], str, str],
|
||||||
|
Tuple[Union[List[URLPattern], List[URLResolver]], None, None],
|
||||||
|
]
|
||||||
],
|
],
|
||||||
kwargs: Any = ...,
|
kwargs: Optional[
|
||||||
|
Union[
|
||||||
|
Dict[str, Dict[str, Type[FlatPageSitemap]]],
|
||||||
|
Dict[str, Dict[str, Sitemap]],
|
||||||
|
Dict[str, OrderedDict],
|
||||||
|
Dict[str, str],
|
||||||
|
]
|
||||||
|
] = ...,
|
||||||
name: Optional[str] = ...,
|
name: Optional[str] = ...,
|
||||||
) -> Union[URLResolver, URLPattern]: ...
|
) -> Union[URLPattern, URLResolver]: ...
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from django.urls.resolvers import URLPattern, URLResolver
|
|||||||
|
|
||||||
def i18n_patterns(
|
def i18n_patterns(
|
||||||
*urls: Any, prefix_default_language: bool = ...
|
*urls: Any, prefix_default_language: bool = ...
|
||||||
) -> Union[List[URLPattern], List[List[Any]], List[URLResolver]]: ...
|
) -> Union[List[List[Any]], List[URLPattern], List[URLResolver]]: ...
|
||||||
def is_language_prefix_patterns_used(urlconf: str) -> Tuple[bool, bool]: ...
|
def is_language_prefix_patterns_used(urlconf: str) -> Tuple[bool, bool]: ...
|
||||||
|
|
||||||
urlpatterns: Any
|
urlpatterns: Any
|
||||||
|
|||||||
0
django-stubs/contrib/__init__.pyi
Normal file
0
django-stubs/contrib/__init__.pyi
Normal file
@@ -63,15 +63,7 @@ class FieldListFilter(ListFilter):
|
|||||||
def register(
|
def register(
|
||||||
cls,
|
cls,
|
||||||
test: Callable,
|
test: Callable,
|
||||||
list_filter_class: Type[
|
list_filter_class: Type[FieldListFilter],
|
||||||
Union[
|
|
||||||
BooleanFieldListFilter,
|
|
||||||
AllValuesFieldListFilter,
|
|
||||||
DateFieldListFilter,
|
|
||||||
RelatedFieldListFilter,
|
|
||||||
ChoicesFieldListFilter,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
take_priority: bool = ...,
|
take_priority: bool = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -115,7 +107,7 @@ class RelatedFieldListFilter(FieldListFilter):
|
|||||||
field: FieldCacheMixin,
|
field: FieldCacheMixin,
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
model_admin: ModelAdmin,
|
model_admin: ModelAdmin,
|
||||||
) -> Union[List[Tuple[str, str]], List[Tuple[int, str]]]: ...
|
) -> List[Tuple[Union[int, str], str]]: ...
|
||||||
def choices(self, changelist: Any) -> None: ...
|
def choices(self, changelist: Any) -> None: ...
|
||||||
|
|
||||||
class BooleanFieldListFilter(FieldListFilter):
|
class BooleanFieldListFilter(FieldListFilter):
|
||||||
@@ -209,4 +201,4 @@ class RelatedOnlyFieldListFilter(RelatedFieldListFilter):
|
|||||||
used_parameters: Dict[Any, Any]
|
used_parameters: Dict[Any, Any]
|
||||||
def field_choices(
|
def field_choices(
|
||||||
self, field: RelatedField, request: WSGIRequest, model_admin: ModelAdmin
|
self, field: RelatedField, request: WSGIRequest, model_admin: ModelAdmin
|
||||||
) -> Union[List[Tuple[str, str]], List[Tuple[int, str]]]: ...
|
) -> List[Tuple[Union[int, str], str]]: ...
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from django import forms
|
|||||||
from django.contrib.auth.forms import AdminPasswordChangeForm
|
from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||||
from django.db.models.fields import AutoField
|
from django.db.models.fields import AutoField
|
||||||
from django.forms.utils import ErrorDict
|
from django.forms.utils import ErrorDict
|
||||||
from django.forms.widgets import Media
|
from django.forms.widgets import Media, Widget
|
||||||
from django.utils.safestring import SafeText
|
from django.utils.safestring import SafeText
|
||||||
|
|
||||||
ACTION_CHECKBOX_NAME: str
|
ACTION_CHECKBOX_NAME: str
|
||||||
@@ -77,7 +77,7 @@ class Fieldline:
|
|||||||
readonly_fields: Optional[Any] = ...,
|
readonly_fields: Optional[Any] = ...,
|
||||||
model_admin: Optional[Any] = ...,
|
model_admin: Optional[Any] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __iter__(self) -> Iterator[Union[AdminReadonlyField, AdminField]]: ...
|
def __iter__(self) -> Iterator[Union[AdminField, AdminReadonlyField]]: ...
|
||||||
def errors(self) -> SafeText: ...
|
def errors(self) -> SafeText: ...
|
||||||
|
|
||||||
class AdminField:
|
class AdminField:
|
||||||
@@ -133,7 +133,9 @@ class InlineAdminFormSet:
|
|||||||
has_view_permission: bool = ...,
|
has_view_permission: bool = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __iter__(self) -> Iterator[InlineAdminForm]: ...
|
def __iter__(self) -> Iterator[InlineAdminForm]: ...
|
||||||
def fields(self) -> Iterator[Dict[str, Any]]: ...
|
def fields(
|
||||||
|
self
|
||||||
|
) -> Iterator[Dict[str, Union[Dict[str, bool], bool, Widget, str]]]: ...
|
||||||
def inline_formset_data(self) -> str: ...
|
def inline_formset_data(self) -> str: ...
|
||||||
@property
|
@property
|
||||||
def forms(self): ...
|
def forms(self): ...
|
||||||
|
|||||||
@@ -18,18 +18,13 @@ class LogEntryManager(models.Manager):
|
|||||||
self,
|
self,
|
||||||
user_id: int,
|
user_id: int,
|
||||||
content_type_id: int,
|
content_type_id: int,
|
||||||
object_id: Union[str, UUID, int],
|
object_id: Union[int, str, UUID],
|
||||||
object_repr: str,
|
object_repr: str,
|
||||||
action_flag: int,
|
action_flag: int,
|
||||||
change_message: Union[
|
change_message: Union[
|
||||||
List[Dict[str, Dict[str, Union[str, List[str]]]]],
|
|
||||||
Dict[str, Dict[str, List[str]]],
|
Dict[str, Dict[str, List[str]]],
|
||||||
|
List[Dict[str, Dict[str, Union[List[str], str]]]],
|
||||||
str,
|
str,
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Dict[str, List[str]]], Dict[str, Dict[str, str]]
|
|
||||||
]
|
|
||||||
],
|
|
||||||
] = ...,
|
] = ...,
|
||||||
) -> LogEntry: ...
|
) -> LogEntry: ...
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,26 @@
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
|
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.models import LogEntry
|
||||||
|
from django.contrib.admin.sites import AdminSite
|
||||||
from django.contrib.admin.views.main import ChangeList
|
from django.contrib.admin.views.main import ChangeList
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.core.checks.messages import Error
|
from django.core.checks.messages import Error
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.fields import CharField, Field
|
from django.db.models.fields import Field
|
||||||
from django.db.models.fields.related import ForeignKey
|
from django.db.models.fields.related import (ForeignKey, ManyToManyField,
|
||||||
|
RelatedField)
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from django.forms.fields import Field, TypedChoiceField
|
from django.forms.fields import Field, TypedChoiceField
|
||||||
from django.forms.models import ModelChoiceField
|
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
|
||||||
from django.forms.widgets import Media
|
from django.forms.widgets import Media
|
||||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
from django.http.response import (HttpResponse, HttpResponseBase,
|
||||||
from django.template.response import TemplateResponse
|
HttpResponseRedirect, JsonResponse)
|
||||||
|
from django.urls.resolvers import URLPattern
|
||||||
from django.utils.safestring import SafeText
|
from django.utils.safestring import SafeText
|
||||||
|
|
||||||
IS_POPUP_VAR: str
|
IS_POPUP_VAR: str
|
||||||
@@ -27,7 +31,7 @@ VERTICAL: Any
|
|||||||
def get_content_type_for_model(
|
def get_content_type_for_model(
|
||||||
obj: Union[Type[Model], Model]
|
obj: Union[Type[Model], Model]
|
||||||
) -> ContentType: ...
|
) -> ContentType: ...
|
||||||
def get_ul_class(radio_style: Any): ...
|
def get_ul_class(radio_style: int) -> str: ...
|
||||||
|
|
||||||
class IncorrectLookupParameters(Exception): ...
|
class IncorrectLookupParameters(Exception): ...
|
||||||
|
|
||||||
@@ -58,42 +62,48 @@ class BaseModelAdmin:
|
|||||||
self, db_field: Field, request: WSGIRequest, **kwargs: Any
|
self, db_field: Field, request: WSGIRequest, **kwargs: Any
|
||||||
) -> Optional[Field]: ...
|
) -> Optional[Field]: ...
|
||||||
def formfield_for_choice_field(
|
def formfield_for_choice_field(
|
||||||
self, db_field: CharField, request: WSGIRequest, **kwargs: Any
|
self, db_field: Field, request: WSGIRequest, **kwargs: Any
|
||||||
) -> TypedChoiceField: ...
|
) -> TypedChoiceField: ...
|
||||||
def get_field_queryset(
|
def get_field_queryset(
|
||||||
self, db: None, db_field: ForeignKey, request: WSGIRequest
|
self, db: None, db_field: RelatedField, request: WSGIRequest
|
||||||
) -> None: ...
|
) -> Optional[QuerySet]: ...
|
||||||
def formfield_for_foreignkey(
|
def formfield_for_foreignkey(
|
||||||
self, db_field: ForeignKey, request: WSGIRequest, **kwargs: Any
|
self, db_field: ForeignKey, request: WSGIRequest, **kwargs: Any
|
||||||
) -> Optional[ModelChoiceField]: ...
|
) -> Optional[ModelChoiceField]: ...
|
||||||
def formfield_for_manytomany(
|
def formfield_for_manytomany(
|
||||||
self, db_field: Any, request: Any, **kwargs: Any
|
self, db_field: ManyToManyField, request: WSGIRequest, **kwargs: Any
|
||||||
): ...
|
) -> ModelMultipleChoiceField: ...
|
||||||
def get_autocomplete_fields(self, request: WSGIRequest) -> Tuple: ...
|
def get_autocomplete_fields(self, request: WSGIRequest) -> Tuple: ...
|
||||||
def get_view_on_site_url(self, obj: Optional[Model] = ...) -> None: ...
|
def get_view_on_site_url(
|
||||||
|
self, obj: Optional[Model] = ...
|
||||||
|
) -> Optional[str]: ...
|
||||||
def get_empty_value_display(self) -> SafeText: ...
|
def get_empty_value_display(self) -> SafeText: ...
|
||||||
def get_exclude(
|
def get_exclude(
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_fields(
|
def get_fields(
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||||
) -> List[str]: ...
|
) -> Union[List[Union[Callable, str]], Tuple[str, str]]: ...
|
||||||
def get_fieldsets(
|
def get_fieldsets(
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||||
) -> Union[
|
) -> Union[
|
||||||
Tuple[Tuple[None, Dict[str, Tuple[Tuple[str, str]]]]],
|
List[Tuple[None, Dict[str, List[Union[Callable, str]]]]],
|
||||||
List[Tuple[None, Dict[str, List[str]]]],
|
Tuple[
|
||||||
|
Tuple[Optional[str], Dict[str, Tuple[Union[Tuple[str, str], str]]]]
|
||||||
|
],
|
||||||
]: ...
|
]: ...
|
||||||
def get_ordering(self, request: WSGIRequest) -> Tuple: ...
|
def get_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
||||||
def get_readonly_fields(
|
def get_readonly_fields(
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||||
) -> Tuple: ...
|
) -> Union[List[str], Tuple]: ...
|
||||||
def get_prepopulated_fields(
|
def get_prepopulated_fields(
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||||
) -> Dict[Any, Any]: ...
|
) -> Dict[str, Tuple[str]]: ...
|
||||||
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
||||||
def get_sortable_by(self, request: WSGIRequest) -> Tuple[str]: ...
|
def get_sortable_by(
|
||||||
def lookup_allowed(self, lookup: Any, value: Any): ...
|
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 to_field_allowed(self, request: WSGIRequest, to_field: str) -> bool: ...
|
||||||
def has_add_permission(self, request: WSGIRequest) -> bool: ...
|
def has_add_permission(self, request: WSGIRequest) -> bool: ...
|
||||||
def has_change_permission(
|
def has_change_permission(
|
||||||
@@ -105,18 +115,14 @@ class BaseModelAdmin:
|
|||||||
def has_view_permission(
|
def has_view_permission(
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
def has_module_permission(self, request: Any): ...
|
def has_module_permission(self, request: WSGIRequest) -> bool: ...
|
||||||
|
|
||||||
class ModelAdmin(BaseModelAdmin):
|
class ModelAdmin(BaseModelAdmin):
|
||||||
formfield_overrides: Dict[
|
formfield_overrides: Dict[
|
||||||
Type[
|
Type[
|
||||||
Union[
|
Union[
|
||||||
django.db.models.fields.DateField,
|
django.db.models.fields.DateTimeCheckMixin,
|
||||||
django.db.models.fields.TimeField,
|
django.db.models.fields.Field,
|
||||||
django.db.models.fields.TextField,
|
|
||||||
django.db.models.fields.IntegerField,
|
|
||||||
django.db.models.fields.CharField,
|
|
||||||
django.db.models.fields.files.FileField,
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
Dict[
|
Dict[
|
||||||
@@ -124,15 +130,7 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
Type[
|
Type[
|
||||||
Union[
|
Union[
|
||||||
django.forms.fields.SplitDateTimeField,
|
django.forms.fields.SplitDateTimeField,
|
||||||
django.contrib.admin.widgets.AdminSplitDateTime,
|
django.forms.widgets.Widget,
|
||||||
django.contrib.admin.widgets.AdminDateWidget,
|
|
||||||
django.contrib.admin.widgets.AdminTimeWidget,
|
|
||||||
django.contrib.admin.widgets.AdminTextareaWidget,
|
|
||||||
django.contrib.admin.widgets.AdminURLFieldWidget,
|
|
||||||
django.contrib.admin.widgets.AdminIntegerFieldWidget,
|
|
||||||
django.contrib.admin.widgets.AdminTextInputWidget,
|
|
||||||
django.contrib.admin.widgets.AdminFileWidget,
|
|
||||||
django.contrib.admin.widgets.AdminEmailInputWidget,
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -168,16 +166,18 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
model: Type[django.db.models.base.Model] = ...
|
model: Type[django.db.models.base.Model] = ...
|
||||||
opts: django.db.models.options.Options = ...
|
opts: django.db.models.options.Options = ...
|
||||||
admin_site: django.contrib.admin.sites.AdminSite = ...
|
admin_site: django.contrib.admin.sites.AdminSite = ...
|
||||||
def __init__(self, model: Any, admin_site: Any) -> None: ...
|
def __init__(
|
||||||
|
self, model: Type[Model], admin_site: Optional[AdminSite]
|
||||||
|
) -> None: ...
|
||||||
def get_inline_instances(
|
def get_inline_instances(
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||||
) -> List[InlineModelAdmin]: ...
|
) -> List[InlineModelAdmin]: ...
|
||||||
def get_urls(self): ...
|
def get_urls(self) -> List[URLPattern]: ...
|
||||||
@property
|
@property
|
||||||
def urls(self): ...
|
def urls(self) -> List[URLPattern]: ...
|
||||||
@property
|
@property
|
||||||
def media(self) -> Media: ...
|
def media(self) -> Media: ...
|
||||||
def get_model_perms(self, request: Any): ...
|
def get_model_perms(self, request: WSGIRequest) -> Dict[str, bool]: ...
|
||||||
def get_form(
|
def get_form(
|
||||||
self,
|
self,
|
||||||
request: Any,
|
request: Any,
|
||||||
@@ -209,13 +209,18 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
self,
|
self,
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
object: Model,
|
object: Model,
|
||||||
message: List[Dict[str, Dict[str, str]]],
|
message: Union[
|
||||||
|
Dict[str, Dict[Any, Any]], List[Dict[str, Dict[str, str]]]
|
||||||
|
],
|
||||||
) -> LogEntry: ...
|
) -> LogEntry: ...
|
||||||
def log_change(
|
def log_change(
|
||||||
self,
|
self,
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
object: Model,
|
object: Model,
|
||||||
message: List[Dict[str, Dict[str, Union[str, List[str]]]]],
|
message: Union[
|
||||||
|
Dict[str, Dict[str, List[str]]],
|
||||||
|
List[Dict[str, Dict[str, Union[List[str], str]]]],
|
||||||
|
],
|
||||||
) -> LogEntry: ...
|
) -> LogEntry: ...
|
||||||
def log_deletion(
|
def log_deletion(
|
||||||
self, request: WSGIRequest, object: Model, object_repr: str
|
self, request: WSGIRequest, object: Model, object_repr: str
|
||||||
@@ -225,26 +230,42 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
def get_action_choices(
|
def get_action_choices(
|
||||||
self, request: WSGIRequest, default_choices: List[Tuple[str, str]] = ...
|
self, request: WSGIRequest, default_choices: List[Tuple[str, str]] = ...
|
||||||
) -> List[Tuple[str, str]]: ...
|
) -> List[Tuple[str, str]]: ...
|
||||||
def get_action(self, action: Any): ...
|
def get_action(
|
||||||
def get_list_display(self, request: WSGIRequest) -> Tuple[str]: ...
|
self, action: Union[Callable, str]
|
||||||
|
) -> Tuple[Callable, str, str]: ...
|
||||||
|
def get_list_display(
|
||||||
|
self, request: WSGIRequest
|
||||||
|
) -> Union[List[Callable], List[str], Tuple[str]]: ...
|
||||||
def get_list_display_links(
|
def get_list_display_links(
|
||||||
self, request: WSGIRequest, list_display: Tuple[str]
|
self,
|
||||||
) -> List[str]: ...
|
request: WSGIRequest,
|
||||||
def get_list_filter(self, request: WSGIRequest) -> Tuple: ...
|
list_display: Union[List[Callable], List[str], Tuple[str]],
|
||||||
def get_list_select_related(self, request: WSGIRequest) -> bool: ...
|
) -> Optional[Union[List[Callable], List[str], Tuple[str]]]: ...
|
||||||
def get_search_fields(self, request: WSGIRequest) -> Tuple: ...
|
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(
|
def get_search_results(
|
||||||
self, request: WSGIRequest, queryset: QuerySet, search_term: str
|
self, request: WSGIRequest, queryset: QuerySet, search_term: str
|
||||||
) -> Tuple[QuerySet, bool]: ...
|
) -> Tuple[QuerySet, bool]: ...
|
||||||
def get_preserved_filters(self, request: WSGIRequest) -> str: ...
|
def get_preserved_filters(self, request: WSGIRequest) -> str: ...
|
||||||
def construct_change_message(
|
def construct_change_message(
|
||||||
self, request: Any, form: Any, formsets: Any, add: bool = ...
|
self,
|
||||||
): ...
|
request: WSGIRequest,
|
||||||
|
form: AdminPasswordChangeForm,
|
||||||
|
formsets: None,
|
||||||
|
add: bool = ...,
|
||||||
|
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||||
def message_user(
|
def message_user(
|
||||||
self,
|
self,
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
message: str,
|
message: str,
|
||||||
level: int = ...,
|
level: Union[int, str] = ...,
|
||||||
extra_tags: str = ...,
|
extra_tags: str = ...,
|
||||||
fail_silently: bool = ...,
|
fail_silently: bool = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@@ -253,7 +274,9 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
self, request: Any, obj: Any, form: Any, change: Any
|
self, request: Any, obj: Any, form: Any, change: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def delete_model(self, request: WSGIRequest, obj: Model) -> None: ...
|
def delete_model(self, request: WSGIRequest, obj: Model) -> None: ...
|
||||||
def delete_queryset(self, request: Any, queryset: Any) -> None: ...
|
def delete_queryset(
|
||||||
|
self, request: WSGIRequest, queryset: QuerySet
|
||||||
|
) -> None: ...
|
||||||
def save_formset(
|
def save_formset(
|
||||||
self, request: Any, form: Any, formset: Any, change: Any
|
self, request: Any, form: Any, formset: Any, change: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@@ -279,11 +302,11 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
self, request: WSGIRequest, obj: Model
|
self, request: WSGIRequest, obj: Model
|
||||||
) -> HttpResponseRedirect: ...
|
) -> HttpResponseRedirect: ...
|
||||||
def response_post_save_change(
|
def response_post_save_change(
|
||||||
self, request: WSGIRequest, obj: User
|
self, request: WSGIRequest, obj: Model
|
||||||
) -> HttpResponseRedirect: ...
|
) -> HttpResponseRedirect: ...
|
||||||
def response_action(
|
def response_action(
|
||||||
self, request: WSGIRequest, queryset: QuerySet
|
self, request: WSGIRequest, queryset: QuerySet
|
||||||
) -> Optional[TemplateResponse]: ...
|
) -> Optional[HttpResponseBase]: ...
|
||||||
def response_delete(
|
def response_delete(
|
||||||
self, request: WSGIRequest, obj_display: str, obj_id: int
|
self, request: WSGIRequest, obj_display: str, obj_id: int
|
||||||
) -> HttpResponse: ...
|
) -> HttpResponse: ...
|
||||||
@@ -297,15 +320,15 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
) -> List[Any]: ...
|
) -> List[Any]: ...
|
||||||
def get_changeform_initial_data(
|
def get_changeform_initial_data(
|
||||||
self, request: WSGIRequest
|
self, request: WSGIRequest
|
||||||
) -> Dict[Any, Any]: ...
|
) -> Dict[str, str]: ...
|
||||||
def changeform_view(
|
def changeform_view(
|
||||||
self,
|
self,
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
object_id: Optional[str] = ...,
|
object_id: Optional[str] = ...,
|
||||||
form_url: str = ...,
|
form_url: str = ...,
|
||||||
extra_context: None = ...,
|
extra_context: Optional[Dict[str, bool]] = ...,
|
||||||
) -> Any: ...
|
) -> Any: ...
|
||||||
def autocomplete_view(self, request: Any): ...
|
def autocomplete_view(self, request: WSGIRequest) -> JsonResponse: ...
|
||||||
def add_view(
|
def add_view(
|
||||||
self,
|
self,
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
@@ -317,13 +340,13 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
object_id: str,
|
object_id: str,
|
||||||
form_url: str = ...,
|
form_url: str = ...,
|
||||||
extra_context: None = ...,
|
extra_context: Optional[Dict[str, bool]] = ...,
|
||||||
) -> HttpResponse: ...
|
) -> HttpResponse: ...
|
||||||
def changelist_view(
|
def changelist_view(
|
||||||
self,
|
self,
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
extra_context: Optional[Dict[str, str]] = ...,
|
extra_context: Optional[Dict[str, str]] = ...,
|
||||||
) -> HttpResponse: ...
|
) -> HttpResponseBase: ...
|
||||||
def get_deleted_objects(
|
def get_deleted_objects(
|
||||||
self, objs: QuerySet, request: WSGIRequest
|
self, objs: QuerySet, request: WSGIRequest
|
||||||
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
||||||
@@ -332,7 +355,7 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
) -> Any: ...
|
) -> Any: ...
|
||||||
def history_view(
|
def history_view(
|
||||||
self, request: WSGIRequest, object_id: str, extra_context: None = ...
|
self, request: WSGIRequest, object_id: str, extra_context: None = ...
|
||||||
) -> TemplateResponse: ...
|
) -> HttpResponse: ...
|
||||||
|
|
||||||
class InlineModelAdmin(BaseModelAdmin):
|
class InlineModelAdmin(BaseModelAdmin):
|
||||||
model: Any = ...
|
model: Any = ...
|
||||||
@@ -352,7 +375,9 @@ class InlineModelAdmin(BaseModelAdmin):
|
|||||||
parent_model: Any = ...
|
parent_model: Any = ...
|
||||||
opts: Any = ...
|
opts: Any = ...
|
||||||
has_registered_model: Any = ...
|
has_registered_model: Any = ...
|
||||||
def __init__(self, parent_model: Any, admin_site: Any) -> None: ...
|
def __init__(
|
||||||
|
self, parent_model: Union[Type[Model], Model], admin_site: AdminSite
|
||||||
|
) -> None: ...
|
||||||
@property
|
@property
|
||||||
def media(self) -> Media: ...
|
def media(self) -> Media: ...
|
||||||
def get_extra(
|
def get_extra(
|
||||||
@@ -363,7 +388,7 @@ class InlineModelAdmin(BaseModelAdmin):
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_max_num(
|
def get_max_num(
|
||||||
self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any
|
self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any
|
||||||
) -> None: ...
|
) -> Optional[int]: ...
|
||||||
fields: Any = ...
|
fields: Any = ...
|
||||||
def get_formset(
|
def get_formset(
|
||||||
self, request: Any, obj: Optional[Any] = ..., **kwargs: Any
|
self, request: Any, obj: Optional[Any] = ..., **kwargs: Any
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class AdminSite:
|
|||||||
def register(
|
def register(
|
||||||
self,
|
self,
|
||||||
model_or_iterable: Union[
|
model_or_iterable: Union[
|
||||||
Tuple[Type[Model]], Type[Model], List[Type[Model]]
|
List[Type[Model]], Tuple[Type[Model]], Type[Model]
|
||||||
],
|
],
|
||||||
admin_class: Optional[Type[ModelAdmin]] = ...,
|
admin_class: Optional[Type[ModelAdmin]] = ...,
|
||||||
**options: Any
|
**options: Any
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ register: Any
|
|||||||
DOT: str
|
DOT: str
|
||||||
|
|
||||||
def paginator_number(cl: ChangeList, i: int) -> SafeText: ...
|
def paginator_number(cl: ChangeList, i: int) -> SafeText: ...
|
||||||
def pagination(cl: ChangeList) -> Dict[str, Any]: ...
|
def pagination(
|
||||||
|
cl: ChangeList
|
||||||
|
) -> Dict[str, Union[List[Union[int, str]], ChangeList, int, range, str]]: ...
|
||||||
def pagination_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
def pagination_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
def result_headers(
|
def result_headers(
|
||||||
cl: ChangeList
|
cl: ChangeList
|
||||||
@@ -30,18 +32,24 @@ class ResultList(list):
|
|||||||
|
|
||||||
def results(cl: ChangeList) -> Iterator[ResultList]: ...
|
def results(cl: ChangeList) -> Iterator[ResultList]: ...
|
||||||
def result_hidden_fields(cl: ChangeList) -> Iterator[BoundField]: ...
|
def result_hidden_fields(cl: ChangeList) -> Iterator[BoundField]: ...
|
||||||
def result_list(cl: ChangeList) -> Dict[str, Any]: ...
|
def result_list(
|
||||||
|
cl: ChangeList
|
||||||
|
) -> 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 result_list_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
def date_hierarchy(
|
def date_hierarchy(
|
||||||
cl: ChangeList
|
cl: ChangeList
|
||||||
) -> Optional[
|
) -> Optional[Dict[str, Union[Dict[str, str], List[Dict[str, str]], bool]]]: ...
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, Dict[str, str], List[Any]]],
|
|
||||||
Dict[str, Union[bool, Dict[str, str], List[Dict[str, str]]]],
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def date_hierarchy_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
def date_hierarchy_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
def search_form(cl: ChangeList) -> Dict[str, Union[ChangeList, bool, str]]: ...
|
def search_form(cl: ChangeList) -> Dict[str, Union[bool, ChangeList, str]]: ...
|
||||||
def search_form_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
def search_form_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||||
def admin_list_filter(cl: ChangeList, spec: FieldListFilter) -> SafeText: ...
|
def admin_list_filter(cl: ChangeList, spec: FieldListFilter) -> SafeText: ...
|
||||||
def admin_actions(context: RequestContext) -> RequestContext: ...
|
def admin_actions(context: RequestContext) -> RequestContext: ...
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ from django.utils.safestring import SafeText
|
|||||||
register: Any
|
register: Any
|
||||||
|
|
||||||
def admin_urlname(value: Options, arg: SafeText) -> str: ...
|
def admin_urlname(value: Options, arg: SafeText) -> str: ...
|
||||||
def admin_urlquote(value: Union[str, UUID, int]) -> Union[str, UUID, int]: ...
|
def admin_urlquote(value: Union[int, str, UUID]) -> Union[int, str, UUID]: ...
|
||||||
def add_preserved_filters(
|
def add_preserved_filters(
|
||||||
context: Union[Dict[str, Union[str, Options]], RequestContext],
|
context: Union[Dict[str, Union[Options, str]], RequestContext],
|
||||||
url: str,
|
url: str,
|
||||||
popup: bool = ...,
|
popup: bool = ...,
|
||||||
to_field: Optional[str] = ...,
|
to_field: Optional[str] = ...,
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
from datetime import date, datetime
|
from datetime import datetime
|
||||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
||||||
|
from uuid import UUID
|
||||||
|
|
||||||
from django.contrib.admin.options import BaseModelAdmin
|
from django.contrib.admin.options import BaseModelAdmin
|
||||||
from django.contrib.admin.sites import AdminSite
|
from django.contrib.admin.sites import AdminSite
|
||||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.deletion import Collector
|
from django.db.models.deletion import Collector
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import Field
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
from django.db.models.fields.mixins import FieldCacheMixin
|
||||||
from django.db.models.fields.reverse_related import ManyToOneRel, OneToOneRel
|
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
||||||
|
ManyToOneRel, OneToOneRel)
|
||||||
from django.db.models.options import Options
|
from django.db.models.options import Options
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from django.utils.safestring import SafeText
|
from django.utils.safestring import SafeText
|
||||||
@@ -19,29 +21,26 @@ class FieldIsAForeignKeyColumnName(Exception): ...
|
|||||||
|
|
||||||
def lookup_needs_distinct(opts: Options, lookup_path: str) -> bool: ...
|
def lookup_needs_distinct(opts: Options, lookup_path: str) -> bool: ...
|
||||||
def prepare_lookup_value(
|
def prepare_lookup_value(
|
||||||
key: str, value: Union[str, datetime]
|
key: str, value: Union[datetime, str]
|
||||||
) -> Union[bool, datetime, str]: ...
|
) -> Union[bool, datetime, str]: ...
|
||||||
def quote(s: Union[str, int]) -> Union[str, int]: ...
|
def quote(s: Union[int, str, UUID]) -> Union[int, str, UUID]: ...
|
||||||
def unquote(s: str) -> str: ...
|
def unquote(s: str) -> str: ...
|
||||||
def flatten(
|
def flatten(
|
||||||
fields: Union[
|
fields: Union[
|
||||||
List[Union[str, Callable]], Tuple[Tuple[str, str]], Tuple[str, str]
|
List[Union[Callable, str]],
|
||||||
|
List[Union[List[str], str]],
|
||||||
|
List[Union[Tuple[str, str], str]],
|
||||||
|
Tuple,
|
||||||
]
|
]
|
||||||
) -> List[Union[str, Callable]]: ...
|
) -> List[Union[Callable, str]]: ...
|
||||||
def flatten_fieldsets(
|
def flatten_fieldsets(
|
||||||
fieldsets: Union[
|
fieldsets: Union[
|
||||||
List[Tuple[None, Dict[str, List[Union[str, Callable]]]]],
|
List[Tuple[Optional[str], Dict[str, Tuple[str]]]],
|
||||||
Tuple[
|
Tuple[
|
||||||
Union[
|
Tuple[Optional[str], Dict[str, Tuple[Union[Tuple[str, str], str]]]]
|
||||||
Tuple[None, Dict[str, Tuple[Tuple[str, str]]]],
|
|
||||||
Tuple[None, Dict[str, Tuple[str]]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
Tuple[str, Dict[str, Tuple[str]]], Tuple[str, Dict[str, Tuple[str]]]
|
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
) -> List[Union[str, Callable]]: ...
|
) -> List[Union[Callable, str]]: ...
|
||||||
def get_deleted_objects(
|
def get_deleted_objects(
|
||||||
objs: QuerySet, request: WSGIRequest, admin_site: AdminSite
|
objs: QuerySet, request: WSGIRequest, admin_site: AdminSite
|
||||||
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
||||||
@@ -59,7 +58,7 @@ class NestedObjects(Collector):
|
|||||||
def add_edge(self, source: Optional[Model], target: Model) -> None: ...
|
def add_edge(self, source: Optional[Model], target: Model) -> None: ...
|
||||||
def collect(
|
def collect(
|
||||||
self,
|
self,
|
||||||
objs: Union[QuerySet, List[Model]],
|
objs: Union[List[Model], QuerySet],
|
||||||
source: Optional[Type[Model]] = ...,
|
source: Optional[Type[Model]] = ...,
|
||||||
source_attr: Optional[str] = ...,
|
source_attr: Optional[str] = ...,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
@@ -69,56 +68,43 @@ class NestedObjects(Collector):
|
|||||||
) -> QuerySet: ...
|
) -> QuerySet: ...
|
||||||
def nested(
|
def nested(
|
||||||
self, format_callback: Callable = ...
|
self, format_callback: Callable = ...
|
||||||
) -> Union[
|
) -> Union[List[SafeText], List[int]]: ...
|
||||||
List[Union[List[str], str]], List[Union[SafeText, List[SafeText]]]
|
|
||||||
]: ...
|
|
||||||
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ...
|
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ...
|
||||||
|
|
||||||
def model_format_dict(obj: Any): ...
|
def model_format_dict(obj: Any): ...
|
||||||
def model_ngettext(obj: QuerySet, n: None = ...) -> str: ...
|
def model_ngettext(
|
||||||
|
obj: Union[Options, QuerySet], n: Optional[int] = ...
|
||||||
|
) -> str: ...
|
||||||
def lookup_field(
|
def lookup_field(
|
||||||
name: Union[str, Callable], obj: Model, model_admin: BaseModelAdmin = ...
|
name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ...
|
||||||
) -> Union[
|
) -> Tuple[Optional[Field], Callable, Callable]: ...
|
||||||
Tuple[
|
|
||||||
Union[str, Model, date, int, None],
|
|
||||||
Union[str, Model, date, int, None],
|
|
||||||
Union[str, Model, date, int, None],
|
|
||||||
],
|
|
||||||
Tuple[None, Callable, Callable],
|
|
||||||
]: ...
|
|
||||||
def label_for_field(
|
def label_for_field(
|
||||||
name: Union[str, Callable],
|
name: Union[Callable, str],
|
||||||
model: Type[Model],
|
model: Type[Model],
|
||||||
model_admin: BaseModelAdmin = ...,
|
model_admin: Optional[BaseModelAdmin] = ...,
|
||||||
return_attr: bool = ...,
|
return_attr: bool = ...,
|
||||||
) -> Union[
|
) -> Union[Tuple[Optional[str], Union[Callable, Type[str]]], str]: ...
|
||||||
Tuple[
|
|
||||||
Union[Type[str], None, Callable, GenericForeignKey],
|
|
||||||
Union[Type[str], None, Callable, GenericForeignKey],
|
|
||||||
],
|
|
||||||
str,
|
|
||||||
]: ...
|
|
||||||
def help_text_for_field(name: str, model: Type[Model]) -> str: ...
|
def help_text_for_field(name: str, model: Type[Model]) -> str: ...
|
||||||
def display_for_field(
|
def display_for_field(
|
||||||
value: Optional[Union[int, str, date, Model]],
|
value: Any,
|
||||||
field: Union[Field, reverse_related.OneToOneRel],
|
field: Union[Field, reverse_related.OneToOneRel],
|
||||||
empty_value_display: SafeText,
|
empty_value_display: str,
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def display_for_value(
|
def display_for_value(
|
||||||
value: Optional[Union[Callable, Model, int, str]],
|
value: Any, empty_value_display: str, boolean: bool = ...
|
||||||
empty_value_display: SafeText,
|
|
||||||
boolean: bool = ...,
|
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
|
|
||||||
class NotRelationField(Exception): ...
|
class NotRelationField(Exception): ...
|
||||||
|
|
||||||
def get_model_from_relation(
|
def get_model_from_relation(
|
||||||
field: Union[Field, reverse_related.ManyToOneRel]
|
field: Union[Field, reverse_related.ForeignObjectRel]
|
||||||
) -> Type[Model]: ...
|
) -> Type[Model]: ...
|
||||||
def reverse_field_path(
|
def reverse_field_path(
|
||||||
model: Type[Model], path: str
|
model: Type[Model], path: str
|
||||||
) -> Tuple[Type[Model], str]: ...
|
) -> Tuple[Type[Model], str]: ...
|
||||||
def get_fields_from_path(
|
def get_fields_from_path(
|
||||||
model: Type[Model], path: str
|
model: Type[Model], path: str
|
||||||
) -> List[Union[FieldCacheMixin, Field]]: ...
|
) -> List[Union[Field, FieldCacheMixin]]: ...
|
||||||
def construct_change_message(form: Any, formsets: Any, add: Any): ...
|
def construct_change_message(
|
||||||
|
form: AdminPasswordChangeForm, formsets: None, add: bool
|
||||||
|
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||||
|
|||||||
0
django-stubs/contrib/admin/views/__init__.pyi
Normal file
0
django-stubs/contrib/admin/views/__init__.pyi
Normal file
@@ -47,29 +47,27 @@ class ChangeList:
|
|||||||
self,
|
self,
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
model: Type[Model],
|
model: Type[Model],
|
||||||
list_display: Union[List[Union[str, Callable]], Tuple[str]],
|
list_display: Union[List[Union[Callable, str]], Tuple[str]],
|
||||||
list_display_links: Optional[
|
list_display_links: Optional[
|
||||||
Union[List[str], Tuple[str], List[Callable]]
|
Union[List[Callable], List[str], Tuple[str]]
|
||||||
],
|
],
|
||||||
list_filter: Union[Tuple, List[Type[SimpleListFilter]], List[str]],
|
list_filter: Union[List[Type[SimpleListFilter]], List[str], Tuple],
|
||||||
date_hierarchy: Optional[str],
|
date_hierarchy: Optional[str],
|
||||||
search_fields: Union[Tuple, List[str]],
|
search_fields: Union[List[str], Tuple],
|
||||||
list_select_related: Union[bool, Tuple],
|
list_select_related: Union[Tuple, bool],
|
||||||
list_per_page: int,
|
list_per_page: int,
|
||||||
list_max_show_all: int,
|
list_max_show_all: int,
|
||||||
list_editable: Union[List[str], Tuple],
|
list_editable: Union[List[str], Tuple],
|
||||||
model_admin: ModelAdmin,
|
model_admin: ModelAdmin,
|
||||||
sortable_by: Union[Tuple, List[Callable], List[str]],
|
sortable_by: Union[List[Callable], List[str], Tuple],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_filters_params(self, params: None = ...) -> Dict[str, str]: ...
|
def get_filters_params(self, params: None = ...) -> Dict[str, str]: ...
|
||||||
def get_filters(
|
def get_filters(
|
||||||
self, request: WSGIRequest
|
self, request: WSGIRequest
|
||||||
) -> Tuple[List[ListFilter], bool, bool, bool]: ...
|
) -> Tuple[List[ListFilter], bool, Dict[str, Union[bool, str]], bool]: ...
|
||||||
def get_query_string(
|
def get_query_string(
|
||||||
self,
|
self,
|
||||||
new_params: Optional[
|
new_params: Optional[Dict[str, None]] = ...,
|
||||||
Union[Dict[str, Union[str, int]], Dict[str, None]]
|
|
||||||
] = ...,
|
|
||||||
remove: Optional[List[str]] = ...,
|
remove: Optional[List[str]] = ...,
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
result_count: Any = ...
|
result_count: Any = ...
|
||||||
@@ -82,7 +80,7 @@ class ChangeList:
|
|||||||
paginator: Any = ...
|
paginator: Any = ...
|
||||||
def get_results(self, request: WSGIRequest) -> None: ...
|
def get_results(self, request: WSGIRequest) -> None: ...
|
||||||
def get_ordering_field(
|
def get_ordering_field(
|
||||||
self, field_name: Union[str, Callable]
|
self, field_name: Union[Callable, str]
|
||||||
) -> Optional[Union[CombinedExpression, str]]: ...
|
) -> Optional[Union[CombinedExpression, str]]: ...
|
||||||
def get_ordering(
|
def get_ordering(
|
||||||
self, request: WSGIRequest, queryset: QuerySet
|
self, request: WSGIRequest, queryset: QuerySet
|
||||||
|
|||||||
@@ -1,124 +1,264 @@
|
|||||||
from typing import Any, Optional
|
from collections import OrderedDict
|
||||||
|
from datetime import datetime
|
||||||
|
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
||||||
|
from uuid import UUID
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
|
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
|
||||||
|
from django.forms.widgets import ChoiceWidget, Media, Widget
|
||||||
|
from django.http.request import QueryDict
|
||||||
|
from django.utils.datastructures import MultiValueDict
|
||||||
|
|
||||||
|
|
||||||
class FilteredSelectMultiple(forms.SelectMultiple):
|
class FilteredSelectMultiple(forms.SelectMultiple):
|
||||||
@property
|
@property
|
||||||
def media(self): ...
|
def media(self) -> Media: ...
|
||||||
verbose_name: Any = ...
|
verbose_name: Any = ...
|
||||||
is_stacked: Any = ...
|
is_stacked: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
verbose_name: Any,
|
verbose_name: str,
|
||||||
is_stacked: Any,
|
is_stacked: bool,
|
||||||
attrs: Optional[Any] = ...,
|
attrs: None = ...,
|
||||||
choices: Any = ...,
|
choices: Tuple = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
def get_context(
|
||||||
|
self,
|
||||||
|
name: str,
|
||||||
|
value: Union[List[Any], str],
|
||||||
|
attrs: Optional[Dict[str, str]],
|
||||||
|
) -> Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, Union[int, str]],
|
||||||
|
List[
|
||||||
|
Tuple[
|
||||||
|
None,
|
||||||
|
List[Dict[str, Union[Dict[Any, Any], int, str]]],
|
||||||
|
int,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
Dict[str, Union[Dict[str, Union[int, str]], List[str], bool, str]],
|
||||||
|
],
|
||||||
|
]: ...
|
||||||
|
|
||||||
class AdminDateWidget(forms.DateInput):
|
class AdminDateWidget(forms.DateInput):
|
||||||
|
attrs: Dict[str, str]
|
||||||
|
input_type: str
|
||||||
@property
|
@property
|
||||||
def media(self): ...
|
def media(self) -> Media: ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self, attrs: Optional[Any] = ..., format: Optional[Any] = ...
|
self,
|
||||||
|
attrs: Optional[Dict[str, Union[int, str]]] = ...,
|
||||||
|
format: None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
class AdminTimeWidget(forms.TimeInput):
|
class AdminTimeWidget(forms.TimeInput):
|
||||||
|
attrs: Dict[str, str]
|
||||||
|
input_type: str
|
||||||
@property
|
@property
|
||||||
def media(self): ...
|
def media(self) -> Media: ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self, attrs: Optional[Any] = ..., format: Optional[Any] = ...
|
self,
|
||||||
|
attrs: Optional[Dict[str, Union[int, str]]] = ...,
|
||||||
|
format: None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
||||||
|
attrs: Dict[Any, Any]
|
||||||
|
widgets: List[django.forms.widgets.DateTimeBaseInput]
|
||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
def __init__(self, attrs: None = ...) -> None: ...
|
||||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
def get_context(
|
||||||
|
self,
|
||||||
|
name: str,
|
||||||
|
value: Optional[Union[List[str], datetime]],
|
||||||
|
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||||
|
) -> 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,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
],
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
]: ...
|
||||||
|
|
||||||
class AdminRadioSelect(forms.RadioSelect):
|
class AdminRadioSelect(forms.RadioSelect):
|
||||||
|
attrs: Dict[str, str]
|
||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
|
|
||||||
class AdminFileWidget(forms.ClearableFileInput):
|
class AdminFileWidget(forms.ClearableFileInput):
|
||||||
|
attrs: Dict[Any, Any]
|
||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
|
|
||||||
def url_params_from_lookup_dict(lookups: Any): ...
|
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,
|
||||||
|
]
|
||||||
|
) -> Dict[str, str]: ...
|
||||||
|
|
||||||
class ForeignKeyRawIdWidget(forms.TextInput):
|
class ForeignKeyRawIdWidget(forms.TextInput):
|
||||||
|
attrs: Dict[Any, Any]
|
||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
rel: Any = ...
|
rel: django.db.models.fields.reverse_related.ManyToOneRel = ...
|
||||||
admin_site: Any = ...
|
admin_site: django.contrib.admin.sites.AdminSite = ...
|
||||||
db: Any = ...
|
db: None = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
rel: Any,
|
rel: ForeignObjectRel,
|
||||||
admin_site: Any,
|
admin_site: AdminSite,
|
||||||
attrs: Optional[Any] = ...,
|
attrs: None = ...,
|
||||||
using: Optional[Any] = ...,
|
using: None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
def get_context(
|
||||||
def base_url_parameters(self): ...
|
self,
|
||||||
def url_parameters(self): ...
|
name: str,
|
||||||
def label_and_url_for_value(self, value: Any): ...
|
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]: ...
|
||||||
|
|
||||||
class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
|
class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
|
||||||
|
admin_site: django.contrib.admin.sites.AdminSite
|
||||||
|
attrs: Dict[Any, Any]
|
||||||
|
db: None
|
||||||
|
rel: django.db.models.fields.reverse_related.ManyToManyRel
|
||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
def get_context(
|
||||||
def url_parameters(self): ...
|
self,
|
||||||
def label_and_url_for_value(self, value: Any): ...
|
name: str,
|
||||||
def value_from_datadict(self, data: Any, files: Any, name: Any): ...
|
value: Optional[List[int]],
|
||||||
def format_value(self, value: Any): ...
|
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 format_value(self, value: Optional[List[int]]) -> str: ...
|
||||||
|
|
||||||
class RelatedFieldWidgetWrapper(forms.Widget):
|
class RelatedFieldWidgetWrapper(forms.Widget):
|
||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
needs_multipart_form: Any = ...
|
needs_multipart_form: bool = ...
|
||||||
attrs: Any = ...
|
attrs: Dict[Any, Any] = ...
|
||||||
choices: Any = ...
|
choices: django.forms.models.ModelChoiceIterator = ...
|
||||||
widget: Any = ...
|
widget: django.contrib.admin.widgets.AutocompleteSelect = ...
|
||||||
rel: Any = ...
|
rel: django.db.models.fields.reverse_related.ManyToOneRel = ...
|
||||||
can_add_related: Any = ...
|
can_add_related: bool = ...
|
||||||
can_change_related: Any = ...
|
can_change_related: bool = ...
|
||||||
can_delete_related: Any = ...
|
can_delete_related: bool = ...
|
||||||
can_view_related: Any = ...
|
can_view_related: bool = ...
|
||||||
admin_site: Any = ...
|
admin_site: django.contrib.admin.sites.AdminSite = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
widget: Any,
|
widget: ChoiceWidget,
|
||||||
rel: Any,
|
rel: ForeignObjectRel,
|
||||||
admin_site: Any,
|
admin_site: AdminSite,
|
||||||
can_add_related: Optional[Any] = ...,
|
can_add_related: Optional[bool] = ...,
|
||||||
can_change_related: bool = ...,
|
can_change_related: bool = ...,
|
||||||
can_delete_related: bool = ...,
|
can_delete_related: bool = ...,
|
||||||
can_view_related: bool = ...,
|
can_view_related: bool = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __deepcopy__(self, memo: Any): ...
|
def __deepcopy__(
|
||||||
|
self,
|
||||||
|
memo: Dict[
|
||||||
|
int, Union[List[Union[Field, Widget]], OrderedDict, Field, Widget]
|
||||||
|
],
|
||||||
|
) -> RelatedFieldWidgetWrapper: ...
|
||||||
@property
|
@property
|
||||||
def is_hidden(self): ...
|
def is_hidden(self) -> bool: ...
|
||||||
@property
|
@property
|
||||||
def media(self): ...
|
def media(self) -> Media: ...
|
||||||
def get_related_url(self, info: Any, action: Any, *args: Any): ...
|
def get_related_url(
|
||||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
self, info: Tuple[str, str], action: str, *args: Any
|
||||||
def value_from_datadict(self, data: Any, files: Any, name: Any): ...
|
) -> str: ...
|
||||||
def value_omitted_from_data(self, data: Any, files: Any, name: Any): ...
|
def get_context(
|
||||||
def id_for_label(self, id_: Any): ...
|
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 id_for_label(self, id_: str) -> str: ...
|
||||||
|
|
||||||
class AdminTextareaWidget(forms.Textarea):
|
class AdminTextareaWidget(forms.Textarea):
|
||||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
attrs: Dict[str, str]
|
||||||
|
def __init__(self, attrs: None = ...) -> None: ...
|
||||||
|
|
||||||
class AdminTextInputWidget(forms.TextInput):
|
class AdminTextInputWidget(forms.TextInput):
|
||||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
attrs: Dict[str, str]
|
||||||
|
input_type: str
|
||||||
|
def __init__(self, attrs: None = ...) -> None: ...
|
||||||
|
|
||||||
class AdminEmailInputWidget(forms.EmailInput):
|
class AdminEmailInputWidget(forms.EmailInput):
|
||||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
attrs: Dict[str, str]
|
||||||
|
input_type: str
|
||||||
|
def __init__(self, attrs: None = ...) -> None: ...
|
||||||
|
|
||||||
class AdminURLFieldWidget(forms.URLInput):
|
class AdminURLFieldWidget(forms.URLInput):
|
||||||
|
attrs: Dict[str, str]
|
||||||
|
input_type: str
|
||||||
template_name: str = ...
|
template_name: str = ...
|
||||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
def __init__(self, attrs: None = ...) -> None: ...
|
||||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
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]
|
||||||
|
]: ...
|
||||||
|
|
||||||
class AdminIntegerFieldWidget(forms.NumberInput):
|
class AdminIntegerFieldWidget(forms.NumberInput):
|
||||||
|
attrs: Dict[str, str]
|
||||||
|
input_type: str
|
||||||
class_name: str = ...
|
class_name: str = ...
|
||||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
def __init__(self, attrs: None = ...) -> None: ...
|
||||||
|
|
||||||
class AdminBigIntegerFieldWidget(AdminIntegerFieldWidget):
|
class AdminBigIntegerFieldWidget(AdminIntegerFieldWidget):
|
||||||
class_name: str = ...
|
class_name: str = ...
|
||||||
@@ -134,19 +274,32 @@ class AutocompleteMixin:
|
|||||||
attrs: Any = ...
|
attrs: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
rel: Any,
|
rel: ForeignObjectRel,
|
||||||
admin_site: Any,
|
admin_site: AdminSite,
|
||||||
attrs: Optional[Any] = ...,
|
attrs: Optional[Dict[str, str]] = ...,
|
||||||
choices: Any = ...,
|
choices: Tuple = ...,
|
||||||
using: Optional[Any] = ...,
|
using: None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_url(self): ...
|
def get_url(self) -> str: ...
|
||||||
def build_attrs(
|
def build_attrs(
|
||||||
self, base_attrs: Any, extra_attrs: Optional[Any] = ...
|
self,
|
||||||
): ...
|
base_attrs: Dict[str, str],
|
||||||
def optgroups(self, name: Any, value: Any, attr: Optional[Any] = ...): ...
|
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,
|
||||||
|
]
|
||||||
|
]: ...
|
||||||
@property
|
@property
|
||||||
def media(self): ...
|
def media(self) -> Media: ...
|
||||||
|
|
||||||
class AutocompleteSelect(AutocompleteMixin, forms.Select): ...
|
class AutocompleteSelect(AutocompleteMixin, forms.Select): ...
|
||||||
class AutocompleteSelectMultiple(AutocompleteMixin, forms.SelectMultiple): ...
|
class AutocompleteSelectMultiple(AutocompleteMixin, forms.SelectMultiple): ...
|
||||||
|
|||||||
0
django-stubs/contrib/admindocs/__init__.pyi
Normal file
0
django-stubs/contrib/admindocs/__init__.pyi
Normal file
@@ -4,8 +4,6 @@ from django.core.handlers.wsgi import WSGIRequest
|
|||||||
from django.http.response import HttpResponse
|
from django.http.response import HttpResponse
|
||||||
from django.utils.deprecation import MiddlewareMixin
|
from django.utils.deprecation import MiddlewareMixin
|
||||||
|
|
||||||
from .utils import get_view_name
|
|
||||||
|
|
||||||
|
|
||||||
class XViewMiddleware(MiddlewareMixin):
|
class XViewMiddleware(MiddlewareMixin):
|
||||||
get_response: None
|
get_response: None
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class TemplateDetailView(BaseAdminDocsView):
|
|||||||
def get_context_data(self, **kwargs: Any): ...
|
def get_context_data(self, **kwargs: Any): ...
|
||||||
|
|
||||||
def get_return_data_type(func_name: Any): ...
|
def get_return_data_type(func_name: Any): ...
|
||||||
def get_readable_field_data_type(field: Union[str, Field]) -> str: ...
|
def get_readable_field_data_type(field: Union[Field, str]) -> str: ...
|
||||||
def extract_views_from_urlpatterns(
|
def extract_views_from_urlpatterns(
|
||||||
urlpatterns: Any, base: str = ..., namespace: Optional[Any] = ...
|
urlpatterns: Any, base: str = ..., namespace: Optional[Any] = ...
|
||||||
): ...
|
): ...
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ from django.core.handlers.wsgi import WSGIRequest
|
|||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.options import Options
|
from django.db.models.options import Options
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
from django.utils.functional import SimpleLazyObject
|
|
||||||
|
|
||||||
from .signals import user_logged_in, user_logged_out, user_login_failed
|
from .signals import user_logged_in, user_logged_out, user_login_failed
|
||||||
|
|
||||||
@@ -24,7 +23,7 @@ def authenticate(
|
|||||||
def login(
|
def login(
|
||||||
request: HttpRequest,
|
request: HttpRequest,
|
||||||
user: AbstractBaseUser,
|
user: AbstractBaseUser,
|
||||||
backend: Optional[Union[str, Type[ModelBackend]]] = ...,
|
backend: Optional[Union[Type[ModelBackend], str]] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def logout(request: HttpRequest) -> None: ...
|
def logout(request: HttpRequest) -> None: ...
|
||||||
def get_user_model() -> Type[Model]: ...
|
def get_user_model() -> Type[Model]: ...
|
||||||
@@ -33,7 +32,7 @@ def get_user(
|
|||||||
) -> Union[AbstractBaseUser, AnonymousUser]: ...
|
) -> Union[AbstractBaseUser, AnonymousUser]: ...
|
||||||
def get_permission_codename(action: str, opts: Options) -> str: ...
|
def get_permission_codename(action: str, opts: Options) -> str: ...
|
||||||
def update_session_auth_hash(
|
def update_session_auth_hash(
|
||||||
request: WSGIRequest, user: Union[SimpleLazyObject, AbstractUser]
|
request: WSGIRequest, user: AbstractUser
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
default_app_config: str
|
default_app_config: str
|
||||||
|
|||||||
@@ -16,12 +16,8 @@ class GroupAdmin(admin.ModelAdmin):
|
|||||||
formfield_overrides: Dict[
|
formfield_overrides: Dict[
|
||||||
Type[
|
Type[
|
||||||
Union[
|
Union[
|
||||||
django.db.models.fields.DateField,
|
django.db.models.fields.DateTimeCheckMixin,
|
||||||
django.db.models.fields.TimeField,
|
django.db.models.fields.Field,
|
||||||
django.db.models.fields.TextField,
|
|
||||||
django.db.models.fields.IntegerField,
|
|
||||||
django.db.models.fields.CharField,
|
|
||||||
django.db.models.fields.files.FileField,
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
Dict[
|
Dict[
|
||||||
@@ -29,15 +25,7 @@ class GroupAdmin(admin.ModelAdmin):
|
|||||||
Type[
|
Type[
|
||||||
Union[
|
Union[
|
||||||
django.forms.fields.SplitDateTimeField,
|
django.forms.fields.SplitDateTimeField,
|
||||||
django.contrib.admin.widgets.AdminSplitDateTime,
|
django.forms.widgets.Widget,
|
||||||
django.contrib.admin.widgets.AdminDateWidget,
|
|
||||||
django.contrib.admin.widgets.AdminTimeWidget,
|
|
||||||
django.contrib.admin.widgets.AdminTextareaWidget,
|
|
||||||
django.contrib.admin.widgets.AdminURLFieldWidget,
|
|
||||||
django.contrib.admin.widgets.AdminIntegerFieldWidget,
|
|
||||||
django.contrib.admin.widgets.AdminTextInputWidget,
|
|
||||||
django.contrib.admin.widgets.AdminFileWidget,
|
|
||||||
django.contrib.admin.widgets.AdminEmailInputWidget,
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -59,12 +47,8 @@ class UserAdmin(admin.ModelAdmin):
|
|||||||
formfield_overrides: Dict[
|
formfield_overrides: Dict[
|
||||||
Type[
|
Type[
|
||||||
Union[
|
Union[
|
||||||
django.db.models.fields.DateField,
|
django.db.models.fields.DateTimeCheckMixin,
|
||||||
django.db.models.fields.TimeField,
|
django.db.models.fields.Field,
|
||||||
django.db.models.fields.TextField,
|
|
||||||
django.db.models.fields.IntegerField,
|
|
||||||
django.db.models.fields.CharField,
|
|
||||||
django.db.models.fields.files.FileField,
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
Dict[
|
Dict[
|
||||||
@@ -72,15 +56,7 @@ class UserAdmin(admin.ModelAdmin):
|
|||||||
Type[
|
Type[
|
||||||
Union[
|
Union[
|
||||||
django.forms.fields.SplitDateTimeField,
|
django.forms.fields.SplitDateTimeField,
|
||||||
django.contrib.admin.widgets.AdminSplitDateTime,
|
django.forms.widgets.Widget,
|
||||||
django.contrib.admin.widgets.AdminDateWidget,
|
|
||||||
django.contrib.admin.widgets.AdminTimeWidget,
|
|
||||||
django.contrib.admin.widgets.AdminTextareaWidget,
|
|
||||||
django.contrib.admin.widgets.AdminURLFieldWidget,
|
|
||||||
django.contrib.admin.widgets.AdminIntegerFieldWidget,
|
|
||||||
django.contrib.admin.widgets.AdminTextInputWidget,
|
|
||||||
django.contrib.admin.widgets.AdminFileWidget,
|
|
||||||
django.contrib.admin.widgets.AdminEmailInputWidget,
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class ModelBackend:
|
|||||||
def authenticate(
|
def authenticate(
|
||||||
self,
|
self,
|
||||||
request: Any,
|
request: Any,
|
||||||
username: Optional[Union[str, int]] = ...,
|
username: Optional[Union[int, str]] = ...,
|
||||||
password: Optional[str] = ...,
|
password: Optional[str] = ...,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> Optional[AbstractBaseUser]: ...
|
) -> Optional[AbstractBaseUser]: ...
|
||||||
@@ -28,7 +28,7 @@ class ModelBackend:
|
|||||||
) -> Set[str]: ...
|
) -> Set[str]: ...
|
||||||
def has_perm(
|
def has_perm(
|
||||||
self,
|
self,
|
||||||
user_obj: Union[AnonymousUser, AbstractBaseUser],
|
user_obj: Union[AbstractBaseUser, AnonymousUser],
|
||||||
perm: str,
|
perm: str,
|
||||||
obj: Optional[str] = ...,
|
obj: Optional[str] = ...,
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
|
|||||||
@@ -40,5 +40,5 @@ class AbstractBaseUser(models.Model):
|
|||||||
def get_email_field_name(cls) -> str: ...
|
def get_email_field_name(cls) -> str: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
def normalize_username(
|
def normalize_username(
|
||||||
cls, username: Union[str, int]
|
cls, username: Union[int, str]
|
||||||
) -> Union[str, int]: ...
|
) -> Union[int, str]: ...
|
||||||
|
|||||||
@@ -15,13 +15,11 @@ class PermLookupDict:
|
|||||||
|
|
||||||
class PermWrapper:
|
class PermWrapper:
|
||||||
user: django.utils.functional.SimpleLazyObject = ...
|
user: django.utils.functional.SimpleLazyObject = ...
|
||||||
def __init__(
|
def __init__(self, user: Union[AnonymousUser, User]) -> None: ...
|
||||||
self, user: Union[SimpleLazyObject, AnonymousUser, User]
|
|
||||||
) -> None: ...
|
|
||||||
def __getitem__(self, app_label: str) -> PermLookupDict: ...
|
def __getitem__(self, app_label: str) -> PermLookupDict: ...
|
||||||
def __iter__(self) -> Any: ...
|
def __iter__(self) -> Any: ...
|
||||||
def __contains__(self, perm_name: Union[str, bool]) -> bool: ...
|
def __contains__(self, perm_name: Union[bool, str]) -> bool: ...
|
||||||
|
|
||||||
def auth(
|
def auth(
|
||||||
request: HttpRequest
|
request: HttpRequest
|
||||||
) -> Dict[str, Union[SimpleLazyObject, PermWrapper, User, AnonymousUser]]: ...
|
) -> Dict[str, Union[PermWrapper, AnonymousUser, User]]: ...
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ def login_required(
|
|||||||
login_url: Optional[str] = ...,
|
login_url: Optional[str] = ...,
|
||||||
) -> Callable: ...
|
) -> Callable: ...
|
||||||
def permission_required(
|
def permission_required(
|
||||||
perm: Union[str, List[str], Set[str]],
|
perm: Union[List[str], Set[str], str],
|
||||||
login_url: None = ...,
|
login_url: None = ...,
|
||||||
raise_exception: bool = ...,
|
raise_exception: bool = ...,
|
||||||
) -> Callable: ...
|
) -> Callable: ...
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ from django.contrib.auth.models import AbstractUser, User
|
|||||||
from django.contrib.auth.tokens import PasswordResetTokenGenerator
|
from django.contrib.auth.tokens import PasswordResetTokenGenerator
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.utils.functional import SimpleLazyObject
|
|
||||||
|
|
||||||
UserModel: Any
|
UserModel: Any
|
||||||
|
|
||||||
@@ -18,10 +17,8 @@ class ReadOnlyPasswordHashWidget(forms.Widget):
|
|||||||
) -> Dict[
|
) -> Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[str, bool, None, Dict[Any, Any]]],
|
Dict[str, Optional[Union[Dict[str, str], bool, str]]],
|
||||||
List[Dict[str, str]],
|
List[Dict[str, str]],
|
||||||
Dict[str, Union[str, bool, None, Dict[str, str]]],
|
|
||||||
Dict[str, Union[str, bool, Dict[str, str]]],
|
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
|
|
||||||
@@ -63,7 +60,7 @@ class UserChangeForm(forms.ModelForm):
|
|||||||
error_class: Type[django.forms.utils.ErrorList]
|
error_class: Type[django.forms.utils.ErrorList]
|
||||||
fields: collections.OrderedDict
|
fields: collections.OrderedDict
|
||||||
files: Dict[Any, Any]
|
files: Dict[Any, Any]
|
||||||
initial: Dict[str, Optional[Union[int, str, datetime.datetime, List[Any]]]]
|
initial: Dict[str, Optional[Union[List[Any], datetime.datetime, int, str]]]
|
||||||
instance: django.contrib.auth.models.User
|
instance: django.contrib.auth.models.User
|
||||||
is_bound: bool
|
is_bound: bool
|
||||||
label_suffix: str
|
label_suffix: str
|
||||||
@@ -114,7 +111,7 @@ class PasswordResetForm(forms.Form):
|
|||||||
self,
|
self,
|
||||||
subject_template_name: str,
|
subject_template_name: str,
|
||||||
email_template_name: str,
|
email_template_name: str,
|
||||||
context: Dict[str, Union[str, AbstractBaseUser]],
|
context: Dict[str, Union[AbstractBaseUser, str]],
|
||||||
from_email: Optional[str],
|
from_email: Optional[str],
|
||||||
to_email: str,
|
to_email: str,
|
||||||
html_email_template_name: Optional[str] = ...,
|
html_email_template_name: Optional[str] = ...,
|
||||||
@@ -148,15 +145,10 @@ class SetPasswordForm(forms.Form):
|
|||||||
new_password2: Any = ...
|
new_password2: Any = ...
|
||||||
user: django.contrib.auth.models.User = ...
|
user: django.contrib.auth.models.User = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, user: Optional[AbstractBaseUser], *args: Any, **kwargs: Any
|
||||||
user: Optional[Union[SimpleLazyObject, AbstractBaseUser]],
|
|
||||||
*args: Any,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def clean_new_password2(self) -> str: ...
|
def clean_new_password2(self) -> str: ...
|
||||||
def save(
|
def save(self, commit: bool = ...) -> AbstractBaseUser: ...
|
||||||
self, commit: bool = ...
|
|
||||||
) -> Union[AbstractBaseUser, SimpleLazyObject]: ...
|
|
||||||
|
|
||||||
class PasswordChangeForm(SetPasswordForm):
|
class PasswordChangeForm(SetPasswordForm):
|
||||||
auto_id: str
|
auto_id: str
|
||||||
|
|||||||
0
django-stubs/contrib/auth/handlers/__init__.pyi
Normal file
0
django-stubs/contrib/auth/handlers/__init__.pyi
Normal file
@@ -22,4 +22,4 @@ class Command(BaseCommand):
|
|||||||
def handle(self, *args: Any, **options: Any) -> None: ...
|
def handle(self, *args: Any, **options: Any) -> None: ...
|
||||||
def get_input_data(
|
def get_input_data(
|
||||||
self, field: Field, message: str, default: Optional[str] = ...
|
self, field: Field, message: str, default: Optional[str] = ...
|
||||||
) -> Optional[Union[str, int]]: ...
|
) -> Optional[Union[int, str]]: ...
|
||||||
|
|||||||
@@ -80,10 +80,10 @@ class PermissionsMixin(models.Model):
|
|||||||
def get_group_permissions(self, obj: None = ...) -> Set[str]: ...
|
def get_group_permissions(self, obj: None = ...) -> Set[str]: ...
|
||||||
def get_all_permissions(self, obj: Optional[str] = ...) -> Set[str]: ...
|
def get_all_permissions(self, obj: Optional[str] = ...) -> Set[str]: ...
|
||||||
def has_perm(
|
def has_perm(
|
||||||
self, perm: Union[str, Tuple[str, Any]], obj: Optional[str] = ...
|
self, perm: Union[Tuple[str, Any], str], obj: Optional[str] = ...
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
def has_perms(
|
def has_perms(
|
||||||
self, perm_list: Union[Set[str], List[str], Tuple[str]], obj: None = ...
|
self, perm_list: Union[List[str], Set[str], Tuple[str]], obj: None = ...
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
def has_module_perms(self, app_label: str) -> bool: ...
|
def has_module_perms(self, app_label: str) -> bool: ...
|
||||||
|
|
||||||
|
|||||||
@@ -3,24 +3,19 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|||||||
|
|
||||||
from django.contrib.auth.base_user import AbstractBaseUser
|
from django.contrib.auth.base_user import AbstractBaseUser
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils.functional import SimpleLazyObject
|
|
||||||
|
|
||||||
|
|
||||||
def get_default_password_validators() -> Union[
|
def get_default_password_validators() -> Union[
|
||||||
List[Union[CommonPasswordValidator, MinimumLengthValidator]],
|
List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]
|
||||||
List[Union[UserAttributeSimilarityValidator, MinimumLengthValidator]],
|
|
||||||
List[NumericPasswordValidator],
|
|
||||||
]: ...
|
]: ...
|
||||||
def get_password_validators(
|
def get_password_validators(
|
||||||
validator_config: List[Dict[str, Union[str, Dict[str, int]]]]
|
validator_config: List[Dict[str, Union[Dict[str, int], str]]]
|
||||||
) -> Union[
|
) -> Union[
|
||||||
List[Union[CommonPasswordValidator, MinimumLengthValidator]],
|
List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]
|
||||||
List[Union[UserAttributeSimilarityValidator, MinimumLengthValidator]],
|
|
||||||
List[NumericPasswordValidator],
|
|
||||||
]: ...
|
]: ...
|
||||||
def validate_password(
|
def validate_password(
|
||||||
password: str,
|
password: str,
|
||||||
user: Optional[Union[AbstractBaseUser, SimpleLazyObject]] = ...,
|
user: Optional[AbstractBaseUser] = ...,
|
||||||
password_validators: Optional[List[Any]] = ...,
|
password_validators: Optional[List[Any]] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def password_changed(
|
def password_changed(
|
||||||
@@ -46,7 +41,7 @@ class UserAttributeSimilarityValidator:
|
|||||||
max_similarity: float = ...
|
max_similarity: float = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
user_attributes: Union[Tuple[str, str, str, str], List[str]] = ...,
|
user_attributes: Union[List[str], Tuple[str, str, str, str]] = ...,
|
||||||
max_similarity: float = ...,
|
max_similarity: float = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def validate(self, password: str, user: Optional[User] = ...) -> None: ...
|
def validate(self, password: str, user: Optional[User] = ...) -> None: ...
|
||||||
@@ -56,7 +51,7 @@ class CommonPasswordValidator:
|
|||||||
DEFAULT_PASSWORD_LIST_PATH: Any = ...
|
DEFAULT_PASSWORD_LIST_PATH: Any = ...
|
||||||
passwords: Set[str] = ...
|
passwords: Set[str] = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self, password_list_path: Union[str, PosixPath] = ...
|
self, password_list_path: Union[PosixPath, str] = ...
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def validate(self, password: str, user: None = ...) -> None: ...
|
def validate(self, password: str, user: None = ...) -> None: ...
|
||||||
def get_help_text(self) -> str: ...
|
def get_help_text(self) -> str: ...
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ from django.http.request import HttpRequest
|
|||||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
from django.utils.datastructures import MultiValueDict
|
from django.utils.datastructures import MultiValueDict
|
||||||
from django.utils.functional import SimpleLazyObject
|
|
||||||
from django.views.generic.base import TemplateView
|
from django.views.generic.base import TemplateView
|
||||||
from django.views.generic.edit import FormView
|
from django.views.generic.edit import FormView
|
||||||
|
|
||||||
@@ -37,16 +36,13 @@ class LoginView(SuccessURLAllowedHostsMixin, FormView):
|
|||||||
def get_form_kwargs(
|
def get_form_kwargs(
|
||||||
self
|
self
|
||||||
) -> Dict[
|
) -> Dict[
|
||||||
str,
|
str, Optional[Union[Dict[str, str], HttpRequest, MultiValueDict]]
|
||||||
Optional[
|
|
||||||
Union[Dict[Any, Any], Dict[str, str], MultiValueDict, HttpRequest]
|
|
||||||
],
|
|
||||||
]: ...
|
]: ...
|
||||||
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
||||||
def get_context_data(
|
def get_context_data(
|
||||||
self, **kwargs: Any
|
self, **kwargs: Any
|
||||||
) -> Dict[
|
) -> Dict[
|
||||||
str, Union[AuthenticationForm, LoginView, str, Site, RequestSite]
|
str, Union[AuthenticationForm, LoginView, Site, RequestSite, str]
|
||||||
]: ...
|
]: ...
|
||||||
|
|
||||||
class LogoutView(SuccessURLAllowedHostsMixin, TemplateView):
|
class LogoutView(SuccessURLAllowedHostsMixin, TemplateView):
|
||||||
@@ -112,7 +108,7 @@ class PasswordResetConfirmView(PasswordContextMixin, FormView):
|
|||||||
def get_form_kwargs(
|
def get_form_kwargs(
|
||||||
self
|
self
|
||||||
) -> Dict[
|
) -> Dict[
|
||||||
str, Optional[Union[Dict[Any, Any], MultiValueDict, AbstractBaseUser]]
|
str, Optional[Union[Dict[Any, Any], AbstractBaseUser, MultiValueDict]]
|
||||||
]: ...
|
]: ...
|
||||||
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
|
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
|
||||||
def get_context_data(self, **kwargs: Any): ...
|
def get_context_data(self, **kwargs: Any): ...
|
||||||
@@ -130,10 +126,7 @@ class PasswordChangeView(PasswordContextMixin, FormView):
|
|||||||
def dispatch(self, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
def dispatch(self, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||||
def get_form_kwargs(
|
def get_form_kwargs(
|
||||||
self
|
self
|
||||||
) -> Dict[
|
) -> Dict[str, Optional[Union[Dict[Any, Any], User, MultiValueDict]]]: ...
|
||||||
str,
|
|
||||||
Optional[Union[Dict[Any, Any], User, MultiValueDict, SimpleLazyObject]],
|
|
||||||
]: ...
|
|
||||||
def form_valid(self, form: PasswordChangeForm) -> HttpResponseRedirect: ...
|
def form_valid(self, form: PasswordChangeForm) -> HttpResponseRedirect: ...
|
||||||
|
|
||||||
class PasswordChangeDoneView(PasswordContextMixin, TemplateView):
|
class PasswordChangeDoneView(PasswordContextMixin, TemplateView):
|
||||||
|
|||||||
0
django-stubs/contrib/contenttypes/__init__.pyi
Normal file
0
django-stubs/contrib/contenttypes/__init__.pyi
Normal file
@@ -42,7 +42,7 @@ class GenericForeignKey(FieldCacheMixin):
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_filter_kwargs_for_object(
|
def get_filter_kwargs_for_object(
|
||||||
self, obj: Model
|
self, obj: Model
|
||||||
) -> Dict[str, Optional[Union[int, ContentType]]]: ...
|
) -> Dict[str, Optional[ContentType]]: ...
|
||||||
def get_forward_related_filter(self, obj: Model) -> Dict[str, int]: ...
|
def get_forward_related_filter(self, obj: Model) -> Dict[str, int]: ...
|
||||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||||
def get_cache_name(self) -> str: ...
|
def get_cache_name(self) -> str: ...
|
||||||
@@ -54,12 +54,12 @@ class GenericForeignKey(FieldCacheMixin):
|
|||||||
) -> ContentType: ...
|
) -> ContentType: ...
|
||||||
def get_prefetch_queryset(
|
def get_prefetch_queryset(
|
||||||
self,
|
self,
|
||||||
instances: Union[QuerySet, List[Model]],
|
instances: Union[List[Model], QuerySet],
|
||||||
queryset: Optional[QuerySet] = ...,
|
queryset: Optional[QuerySet] = ...,
|
||||||
) -> Tuple[List[Model], Callable, Callable, bool, str, bool]: ...
|
) -> Tuple[List[Model], Callable, Callable, bool, str, bool]: ...
|
||||||
def __get__(
|
def __get__(
|
||||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||||
) -> Optional[Union[Model, GenericForeignKey]]: ...
|
) -> Optional[Union[GenericForeignKey, Model]]: ...
|
||||||
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
|
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
|
||||||
|
|
||||||
class GenericRel(ForeignObjectRel):
|
class GenericRel(ForeignObjectRel):
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from django.db import migrations
|
|||||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||||
from django.db.migrations.migration import Migration
|
from django.db.migrations.migration import Migration
|
||||||
from django.db.migrations.state import StateApps
|
from django.db.migrations.state import StateApps
|
||||||
|
from django.db.models.base import Model
|
||||||
|
|
||||||
|
|
||||||
class RenameContentType(migrations.RunPython):
|
class RenameContentType(migrations.RunPython):
|
||||||
@@ -31,7 +32,7 @@ def inject_rename_contenttypes_operations(
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_contenttypes_and_models(
|
def get_contenttypes_and_models(
|
||||||
app_config: AppConfig, using: str, ContentType: Type[ContentType]
|
app_config: AppConfig, using: str, ContentType: Type[ContentType]
|
||||||
) -> Tuple[Dict[str, ContentType], Dict]: ...
|
) -> Tuple[Dict[str, ContentType], Dict[str, Type[Model]]]: ...
|
||||||
def create_contenttypes(
|
def create_contenttypes(
|
||||||
app_config: AppConfig,
|
app_config: AppConfig,
|
||||||
verbosity: int = ...,
|
verbosity: int = ...,
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
from typing import Any, Optional, Type, Union
|
from typing import Any, Dict, Optional, Tuple, Type, Union
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
|
|
||||||
class ContentTypeManager(models.Manager):
|
class ContentTypeManager(models.Manager):
|
||||||
@@ -10,11 +11,13 @@ class ContentTypeManager(models.Manager):
|
|||||||
name: None
|
name: None
|
||||||
use_in_migrations: bool = ...
|
use_in_migrations: bool = ...
|
||||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||||
def get_by_natural_key(self, app_label: Any, model: Any): ...
|
def get_by_natural_key(self, app_label: str, model: str) -> ContentType: ...
|
||||||
def get_for_model(
|
def get_for_model(
|
||||||
self, model: Union[Type[Model], Model], for_concrete_model: bool = ...
|
self, model: Union[Type[Model], Model], for_concrete_model: bool = ...
|
||||||
) -> ContentType: ...
|
) -> ContentType: ...
|
||||||
def get_for_models(self, *models: Any, for_concrete_models: bool = ...): ...
|
def get_for_models(
|
||||||
|
self, *models: Any, for_concrete_models: bool = ...
|
||||||
|
) -> Dict[Type[Model], ContentType]: ...
|
||||||
def get_for_id(self, id: int) -> ContentType: ...
|
def get_for_id(self, id: int) -> ContentType: ...
|
||||||
def clear_cache(self) -> None: ...
|
def clear_cache(self) -> None: ...
|
||||||
|
|
||||||
@@ -30,7 +33,7 @@ class ContentType(models.Model):
|
|||||||
unique_together: Any = ...
|
unique_together: Any = ...
|
||||||
@property
|
@property
|
||||||
def name(self) -> str: ...
|
def name(self) -> str: ...
|
||||||
def model_class(self) -> Type[Model]: ...
|
def model_class(self) -> Optional[Type[Model]]: ...
|
||||||
def get_object_for_this_type(self, **kwargs: Any) -> Model: ...
|
def get_object_for_this_type(self, **kwargs: Any) -> Model: ...
|
||||||
def get_all_objects_for_this_type(self, **kwargs: Any): ...
|
def get_all_objects_for_this_type(self, **kwargs: Any) -> QuerySet: ...
|
||||||
def natural_key(self): ...
|
def natural_key(self) -> Tuple[str, str]: ...
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ from django.http.response import HttpResponseRedirect
|
|||||||
|
|
||||||
def shortcut(
|
def shortcut(
|
||||||
request: HttpRequest,
|
request: HttpRequest,
|
||||||
content_type_id: Union[str, int],
|
content_type_id: Union[int, str],
|
||||||
object_id: Union[str, int],
|
object_id: Union[int, str],
|
||||||
) -> HttpResponseRedirect: ...
|
) -> HttpResponseRedirect: ...
|
||||||
|
|||||||
0
django-stubs/contrib/flatpages/__init__.pyi
Normal file
0
django-stubs/contrib/flatpages/__init__.pyi
Normal file
@@ -6,12 +6,12 @@ from django.db.models.query import QuerySet
|
|||||||
|
|
||||||
class FlatpageForm(forms.ModelForm):
|
class FlatpageForm(forms.ModelForm):
|
||||||
auto_id: str
|
auto_id: str
|
||||||
data: Dict[str, Union[str, List[int]]]
|
data: Dict[str, Union[List[int], str]]
|
||||||
empty_permitted: bool
|
empty_permitted: bool
|
||||||
error_class: Type[django.forms.utils.ErrorList]
|
error_class: Type[django.forms.utils.ErrorList]
|
||||||
fields: collections.OrderedDict
|
fields: collections.OrderedDict
|
||||||
files: Dict[Any, Any]
|
files: Dict[Any, Any]
|
||||||
initial: Dict[str, Union[int, str, List[django.contrib.sites.models.Site]]]
|
initial: Dict[str, Union[List[django.contrib.sites.models.Site], int, str]]
|
||||||
instance: django.contrib.flatpages.models.FlatPage
|
instance: django.contrib.flatpages.models.FlatPage
|
||||||
is_bound: bool
|
is_bound: bool
|
||||||
label_suffix: str
|
label_suffix: str
|
||||||
@@ -20,4 +20,4 @@ class FlatpageForm(forms.ModelForm):
|
|||||||
model: Any = ...
|
model: Any = ...
|
||||||
fields: str = ...
|
fields: str = ...
|
||||||
def clean_url(self) -> str: ...
|
def clean_url(self) -> str: ...
|
||||||
def clean(self) -> Dict[str, Union[str, bool, QuerySet]]: ...
|
def clean(self) -> Dict[str, Union[bool, QuerySet, str]]: ...
|
||||||
|
|||||||
0
django-stubs/contrib/humanize/__init__.pyi
Normal file
0
django-stubs/contrib/humanize/__init__.pyi
Normal file
@@ -11,8 +11,8 @@ def intcomma(
|
|||||||
|
|
||||||
intword_converters: Any
|
intword_converters: Any
|
||||||
|
|
||||||
def intword(value: Optional[str]) -> Optional[Union[str, int]]: ...
|
def intword(value: Optional[str]) -> Optional[Union[int, str]]: ...
|
||||||
def apnumber(value: Optional[str]) -> Optional[Union[str, int]]: ...
|
def apnumber(value: Optional[str]) -> Optional[Union[int, str]]: ...
|
||||||
def naturalday(
|
def naturalday(
|
||||||
value: Optional[Union[date, str]], arg: None = ...
|
value: Optional[Union[date, str]], arg: None = ...
|
||||||
) -> Optional[str]: ...
|
) -> Optional[str]: ...
|
||||||
|
|||||||
0
django-stubs/contrib/messages/__init__.pyi
Normal file
0
django-stubs/contrib/messages/__init__.pyi
Normal file
@@ -14,7 +14,7 @@ def add_message(
|
|||||||
extra_tags: str = ...,
|
extra_tags: str = ...,
|
||||||
fail_silently: Union[bool, str] = ...,
|
fail_silently: Union[bool, str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_messages(request: HttpRequest) -> Union[BaseStorage, List[Any]]: ...
|
def get_messages(request: HttpRequest) -> Union[List[Any], BaseStorage]: ...
|
||||||
def get_level(request: HttpRequest) -> int: ...
|
def get_level(request: HttpRequest) -> int: ...
|
||||||
def set_level(request: HttpRequest, level: int) -> bool: ...
|
def set_level(request: HttpRequest, level: int) -> bool: ...
|
||||||
def debug(
|
def debug(
|
||||||
@@ -45,5 +45,5 @@ def error(
|
|||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
message: str,
|
message: str,
|
||||||
extra_tags: str = ...,
|
extra_tags: str = ...,
|
||||||
fail_silently: Union[str, bool] = ...,
|
fail_silently: Union[bool, str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
@@ -1,20 +1,9 @@
|
|||||||
from typing import Any, Dict, List, Optional, Union
|
from typing import Any, Dict, List, Optional, Union
|
||||||
|
|
||||||
from django.contrib.messages.storage.cookie import CookieStorage
|
from django.contrib.messages.storage.base import BaseStorage
|
||||||
from django.contrib.messages.storage.fallback import FallbackStorage
|
|
||||||
from django.contrib.messages.storage.session import SessionStorage
|
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
|
|
||||||
|
|
||||||
def messages(
|
def messages(
|
||||||
request: HttpRequest
|
request: HttpRequest
|
||||||
) -> Dict[
|
) -> Dict[str, Union[Dict[str, int], List[Any], BaseStorage]]: ...
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
List[Any],
|
|
||||||
Dict[str, int],
|
|
||||||
FallbackStorage,
|
|
||||||
SessionStorage,
|
|
||||||
CookieStorage,
|
|
||||||
],
|
|
||||||
]: ...
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Message:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self, level: int, message: str, extra_tags: Optional[str] = ...
|
self, level: int, message: str, extra_tags: Optional[str] = ...
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __eq__(self, other: Union[str, Message]) -> bool: ...
|
def __eq__(self, other: Union[Message, str]) -> bool: ...
|
||||||
@property
|
@property
|
||||||
def tags(self) -> str: ...
|
def tags(self) -> str: ...
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
from typing import Any, Collection, Dict, List, Optional, Union
|
from typing import Any, Dict, List, Optional, Union
|
||||||
|
|
||||||
from django.contrib.messages.storage.base import BaseStorage, Message
|
from django.contrib.messages.storage.base import BaseStorage, Message
|
||||||
|
|
||||||
@@ -14,10 +14,42 @@ class MessageEncoder(json.JSONEncoder):
|
|||||||
skipkeys: bool
|
skipkeys: bool
|
||||||
sort_keys: bool
|
sort_keys: bool
|
||||||
message_key: str = ...
|
message_key: str = ...
|
||||||
def default(self, obj: Message) -> List[Union[str, int]]: ...
|
def default(self, obj: Message) -> List[Union[int, str]]: ...
|
||||||
|
|
||||||
class MessageDecoder(json.JSONDecoder):
|
class MessageDecoder(json.JSONDecoder):
|
||||||
def process_messages(self, obj: Collection) -> Any: ...
|
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]],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
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[Message, str]],
|
||||||
|
Message,
|
||||||
|
str,
|
||||||
|
]: ...
|
||||||
def decode(
|
def decode(
|
||||||
self, s: str, **kwargs: Any
|
self, s: str, **kwargs: Any
|
||||||
) -> Union[
|
) -> Union[
|
||||||
@@ -25,13 +57,13 @@ class MessageDecoder(json.JSONDecoder):
|
|||||||
Union[
|
Union[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[Message, List[Union[Message, Dict[str, Message]]]],
|
Union[List[Union[Dict[str, Message], Message]], Message],
|
||||||
],
|
],
|
||||||
Message,
|
Message,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
Message,
|
|
||||||
List[Union[Message, str]],
|
List[Union[Message, str]],
|
||||||
|
Message,
|
||||||
]: ...
|
]: ...
|
||||||
|
|
||||||
class CookieStorage(BaseStorage):
|
class CookieStorage(BaseStorage):
|
||||||
|
|||||||
@@ -16,5 +16,5 @@ class SessionStorage(BaseStorage):
|
|||||||
self, messages: Union[List[Message], List[str]]
|
self, messages: Union[List[Message], List[str]]
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def deserialize_messages(
|
def deserialize_messages(
|
||||||
self, data: Optional[Union[str, List[Any]]]
|
self, data: Optional[Union[List[Any], str]]
|
||||||
) -> Optional[Union[List[str], List[Message]]]: ...
|
) -> Optional[Union[List[Message], List[str]]]: ...
|
||||||
|
|||||||
0
django-stubs/contrib/postgres/__init__.pyi
Normal file
0
django-stubs/contrib/postgres/__init__.pyi
Normal file
3
django-stubs/contrib/postgres/fields/__init__.pyi
Normal file
3
django-stubs/contrib/postgres/fields/__init__.pyi
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from .array import * # NOQA
|
||||||
|
from .jsonb import * # NOQA
|
||||||
|
from .ranges import * # NOQA
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
from typing import Any, Dict, List, Optional, Tuple
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
|
|
||||||
from django.contrib.postgres import lookups
|
from django.contrib.postgres import lookups
|
||||||
from django.db.models import Field, Transform
|
from django.db.models import Field, Transform
|
||||||
@@ -30,7 +30,11 @@ class ArrayField(CheckFieldDefaultMixin, Field):
|
|||||||
def get_db_prep_value(
|
def get_db_prep_value(
|
||||||
self, value: Any, connection: Any, prepared: bool = ...
|
self, value: Any, connection: Any, prepared: bool = ...
|
||||||
): ...
|
): ...
|
||||||
def deconstruct(self) -> Tuple[None, str, List[Any], Dict[str, Any]]: ...
|
def deconstruct(
|
||||||
|
self
|
||||||
|
) -> Tuple[
|
||||||
|
None, str, List[Any], Dict[str, Optional[Union[bool, Field]]]
|
||||||
|
]: ...
|
||||||
def to_python(self, value: Any): ...
|
def to_python(self, value: Any): ...
|
||||||
def value_to_string(self, obj: Any): ...
|
def value_to_string(self, obj: Any): ...
|
||||||
def get_transform(self, name: Any): ...
|
def get_transform(self, name: Any): ...
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class JSONField(CheckFieldDefaultMixin, Field):
|
|||||||
def deconstruct(
|
def deconstruct(
|
||||||
self
|
self
|
||||||
) -> Tuple[
|
) -> Tuple[
|
||||||
None, str, List[Any], Dict[str, Union[bool, Type[DjangoJSONEncoder]]]
|
None, str, List[Any], Dict[str, Union[Type[DjangoJSONEncoder], bool]]
|
||||||
]: ...
|
]: ...
|
||||||
def get_transform(self, name: Any): ...
|
def get_transform(self, name: Any): ...
|
||||||
def get_prep_value(self, value: Any): ...
|
def get_prep_value(self, value: Any): ...
|
||||||
|
|||||||
0
django-stubs/contrib/redirects/__init__.pyi
Normal file
0
django-stubs/contrib/redirects/__init__.pyi
Normal file
0
django-stubs/contrib/sessions/__init__.pyi
Normal file
0
django-stubs/contrib/sessions/__init__.pyi
Normal file
0
django-stubs/contrib/sessions/backends/__init__.pyi
Normal file
0
django-stubs/contrib/sessions/backends/__init__.pyi
Normal file
@@ -1,4 +1,4 @@
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime
|
||||||
from typing import Any, Dict, Optional, Union
|
from typing import Any, Dict, Optional, Union
|
||||||
|
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
@@ -16,25 +16,21 @@ class SessionBase:
|
|||||||
serializer: Any = ...
|
serializer: Any = ...
|
||||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||||
def __contains__(self, key: str) -> bool: ...
|
def __contains__(self, key: str) -> bool: ...
|
||||||
def __getitem__(self, key: str) -> Union[str, Model, int]: ...
|
def __getitem__(self, key: str) -> Union[Model, int, str]: ...
|
||||||
def __setitem__(
|
def __setitem__(
|
||||||
self, key: str, value: Union[str, datetime, Model, int]
|
self, key: str, value: Union[datetime, Model, int, str]
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __delitem__(self, key: str) -> None: ...
|
def __delitem__(self, key: str) -> None: ...
|
||||||
def get(
|
def get(
|
||||||
self, key: str, default: Optional[str] = ...
|
self, key: str, default: Optional[str] = ...
|
||||||
) -> Optional[Union[str, int, datetime]]: ...
|
) -> Optional[Union[datetime, int, str]]: ...
|
||||||
def pop(self, key: str, default: Any = ...) -> Union[str, int]: ...
|
def pop(self, key: str, default: Any = ...) -> Union[int, str]: ...
|
||||||
def setdefault(self, key: str, value: str) -> str: ...
|
def setdefault(self, key: str, value: str) -> str: ...
|
||||||
def set_test_cookie(self) -> None: ...
|
def set_test_cookie(self) -> None: ...
|
||||||
def test_cookie_worked(self) -> bool: ...
|
def test_cookie_worked(self) -> bool: ...
|
||||||
def delete_test_cookie(self) -> None: ...
|
def delete_test_cookie(self) -> None: ...
|
||||||
def encode(
|
def encode(self, session_dict: Dict[str, Model]) -> str: ...
|
||||||
self, session_dict: Dict[str, Union[str, int, Model, datetime]]
|
def decode(self, session_data: Union[bytes, str]) -> Dict[str, Model]: ...
|
||||||
) -> str: ...
|
|
||||||
def decode(
|
|
||||||
self, session_data: Union[str, bytes]
|
|
||||||
) -> Dict[str, Union[str, int, Model, datetime]]: ...
|
|
||||||
def update(self, dict_: Dict[str, int]) -> None: ...
|
def update(self, dict_: Dict[str, int]) -> None: ...
|
||||||
def has_key(self, key: Any): ...
|
def has_key(self, key: Any): ...
|
||||||
def keys(self): ...
|
def keys(self): ...
|
||||||
@@ -45,9 +41,7 @@ class SessionBase:
|
|||||||
session_key: Any = ...
|
session_key: Any = ...
|
||||||
def get_expiry_age(self, **kwargs: Any) -> int: ...
|
def get_expiry_age(self, **kwargs: Any) -> int: ...
|
||||||
def get_expiry_date(self, **kwargs: Any) -> datetime: ...
|
def get_expiry_date(self, **kwargs: Any) -> datetime: ...
|
||||||
def set_expiry(
|
def set_expiry(self, value: Optional[Union[datetime, int]]) -> None: ...
|
||||||
self, value: Optional[Union[datetime, int, timedelta]]
|
|
||||||
) -> None: ...
|
|
||||||
def get_expire_at_browser_close(self) -> bool: ...
|
def get_expire_at_browser_close(self) -> bool: ...
|
||||||
def flush(self) -> None: ...
|
def flush(self) -> None: ...
|
||||||
def cycle_key(self) -> None: ...
|
def cycle_key(self) -> None: ...
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
from datetime import datetime
|
|
||||||
from typing import Any, Dict, Optional, Type, Union
|
from typing import Any, Dict, Optional, Type, Union
|
||||||
|
|
||||||
from django.contrib.sessions.backends.base import SessionBase
|
from django.contrib.sessions.backends.base import SessionBase
|
||||||
@@ -14,12 +13,12 @@ class SessionStore(SessionBase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_model_class(cls) -> Type[Session]: ...
|
def get_model_class(cls) -> Type[Session]: ...
|
||||||
def model(self) -> Type[AbstractBaseSession]: ...
|
def model(self) -> Type[AbstractBaseSession]: ...
|
||||||
def load(self) -> Dict[str, Union[Model, str, int]]: ...
|
def load(self) -> Dict[str, Union[Model, int, str]]: ...
|
||||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||||
modified: bool = ...
|
modified: bool = ...
|
||||||
def create(self) -> None: ...
|
def create(self) -> None: ...
|
||||||
def create_model_instance(
|
def create_model_instance(
|
||||||
self, data: Dict[str, Union[int, str, Model, datetime]]
|
self, data: Dict[str, Model]
|
||||||
) -> AbstractBaseSession: ...
|
) -> AbstractBaseSession: ...
|
||||||
def save(self, must_create: bool = ...) -> None: ...
|
def save(self, must_create: bool = ...) -> None: ...
|
||||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class SessionStore(SessionBase):
|
|||||||
storage_path: str = ...
|
storage_path: str = ...
|
||||||
file_prefix: str = ...
|
file_prefix: str = ...
|
||||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||||
def load(self) -> Dict[str, Union[str, int]]: ...
|
def load(self) -> Dict[str, Union[int, str]]: ...
|
||||||
modified: bool = ...
|
modified: bool = ...
|
||||||
def create(self) -> None: ...
|
def create(self) -> None: ...
|
||||||
def save(self, must_create: bool = ...) -> None: ...
|
def save(self, must_create: bool = ...) -> None: ...
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from django.contrib.sessions.backends.base import SessionBase
|
|||||||
class SessionStore(SessionBase):
|
class SessionStore(SessionBase):
|
||||||
accessed: bool
|
accessed: bool
|
||||||
serializer: Type[django.core.signing.JSONSerializer]
|
serializer: Type[django.core.signing.JSONSerializer]
|
||||||
def load(self) -> Dict[str, Union[str, datetime]]: ...
|
def load(self) -> Dict[str, Union[datetime, str]]: ...
|
||||||
modified: bool = ...
|
modified: bool = ...
|
||||||
def create(self) -> None: ...
|
def create(self) -> None: ...
|
||||||
def save(self, must_create: bool = ...) -> None: ...
|
def save(self, must_create: bool = ...) -> None: ...
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
from datetime import datetime
|
from typing import Any, Dict, Optional
|
||||||
from typing import Any, Dict, Optional, Union
|
|
||||||
|
|
||||||
from django.core.signing import JSONSerializer as BaseJSONSerializer
|
from django.core.signing import JSONSerializer as BaseJSONSerializer
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
|
|
||||||
|
|
||||||
class PickleSerializer:
|
class PickleSerializer:
|
||||||
def dumps(self, obj: Dict[str, Union[Model, str, datetime]]) -> bytes: ...
|
def dumps(self, obj: Dict[str, Model]) -> bytes: ...
|
||||||
def loads(self, data: bytes) -> Dict[str, Union[Model, str, datetime]]: ...
|
def loads(self, data: bytes) -> Dict[str, Model]: ...
|
||||||
|
|
||||||
JSONSerializer = BaseJSONSerializer
|
JSONSerializer = BaseJSONSerializer
|
||||||
|
|||||||
@@ -22,12 +22,10 @@ class Sitemap:
|
|||||||
def paginator(self) -> Paginator: ...
|
def paginator(self) -> Paginator: ...
|
||||||
def get_urls(
|
def get_urls(
|
||||||
self,
|
self,
|
||||||
page: Union[str, int] = ...,
|
page: Union[int, str] = ...,
|
||||||
site: Optional[Union[RequestSite, Site]] = ...,
|
site: Optional[Union[Site, RequestSite]] = ...,
|
||||||
protocol: Optional[str] = ...,
|
protocol: Optional[str] = ...,
|
||||||
) -> Union[
|
) -> List[Dict[str, Optional[Union[datetime, Model, str]]]]: ...
|
||||||
List[Dict[str, Union[Model, str, datetime, None]]], List[Dict[str, Any]]
|
|
||||||
]: ...
|
|
||||||
|
|
||||||
class GenericSitemap(Sitemap):
|
class GenericSitemap(Sitemap):
|
||||||
priority: None = ...
|
priority: None = ...
|
||||||
@@ -37,7 +35,7 @@ class GenericSitemap(Sitemap):
|
|||||||
protocol: None = ...
|
protocol: None = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
info_dict: Dict[str, Union[QuerySet, datetime, str]],
|
info_dict: Dict[str, Union[datetime, QuerySet, str]],
|
||||||
priority: Optional[float] = ...,
|
priority: Optional[float] = ...,
|
||||||
changefreq: Optional[str] = ...,
|
changefreq: Optional[str] = ...,
|
||||||
protocol: Optional[str] = ...,
|
protocol: Optional[str] = ...,
|
||||||
|
|||||||
0
django-stubs/contrib/sites/__init__.pyi
Normal file
0
django-stubs/contrib/sites/__init__.pyi
Normal file
@@ -7,4 +7,4 @@ from django.http.request import HttpRequest
|
|||||||
|
|
||||||
def get_current_site(
|
def get_current_site(
|
||||||
request: Optional[HttpRequest]
|
request: Optional[HttpRequest]
|
||||||
) -> Union[RequestSite, Site]: ...
|
) -> Union[Site, RequestSite]: ...
|
||||||
|
|||||||
0
django-stubs/contrib/staticfiles/__init__.pyi
Normal file
0
django-stubs/contrib/staticfiles/__init__.pyi
Normal file
@@ -18,7 +18,7 @@ class FileSystemFinder(BaseFinder):
|
|||||||
self, app_names: None = ..., *args: Any, **kwargs: Any
|
self, app_names: None = ..., *args: Any, **kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||||
def find(self, path: str, all: bool = ...) -> Union[str, List[str]]: ...
|
def find(self, path: str, all: bool = ...) -> Union[List[str], str]: ...
|
||||||
def find_location(
|
def find_location(
|
||||||
self, root: str, path: str, prefix: str = ...
|
self, root: str, path: str, prefix: str = ...
|
||||||
) -> Optional[str]: ...
|
) -> Optional[str]: ...
|
||||||
@@ -37,7 +37,7 @@ class AppDirectoriesFinder(BaseFinder):
|
|||||||
def list(
|
def list(
|
||||||
self, ignore_patterns: List[str]
|
self, ignore_patterns: List[str]
|
||||||
) -> Iterator[Tuple[str, FileSystemStorage]]: ...
|
) -> Iterator[Tuple[str, FileSystemStorage]]: ...
|
||||||
def find(self, path: str, all: bool = ...) -> Union[str, List[str]]: ...
|
def find(self, path: str, all: bool = ...) -> Union[List[str], str]: ...
|
||||||
def find_in_app(self, app: str, path: str) -> Optional[str]: ...
|
def find_in_app(self, app: str, path: str) -> Optional[str]: ...
|
||||||
|
|
||||||
class BaseStorageFinder(BaseFinder):
|
class BaseStorageFinder(BaseFinder):
|
||||||
@@ -48,7 +48,7 @@ class BaseStorageFinder(BaseFinder):
|
|||||||
*args: Any,
|
*args: Any,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def find(self, path: str, all: bool = ...) -> Union[str, List[str]]: ...
|
def find(self, path: str, all: bool = ...) -> Union[List[str], str]: ...
|
||||||
def list(
|
def list(
|
||||||
self, ignore_patterns: List[str]
|
self, ignore_patterns: List[str]
|
||||||
) -> Iterator[Tuple[str, DefaultStorage]]: ...
|
) -> Iterator[Tuple[str, DefaultStorage]]: ...
|
||||||
@@ -57,6 +57,6 @@ class DefaultStorageFinder(BaseStorageFinder):
|
|||||||
storage: django.contrib.staticfiles.storage.StaticFilesStorage = ...
|
storage: django.contrib.staticfiles.storage.StaticFilesStorage = ...
|
||||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||||
|
|
||||||
def find(path: str, all: bool = ...) -> Optional[Union[str, List[str]]]: ...
|
def find(path: str, all: bool = ...) -> Optional[Union[List[str], str]]: ...
|
||||||
def get_finders() -> Iterator[BaseFinder]: ...
|
def get_finders() -> Iterator[BaseFinder]: ...
|
||||||
def get_finder(import_path: str) -> BaseFinder: ...
|
def get_finder(import_path: str) -> BaseFinder: ...
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from typing import Any, 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
|
from django.core.management.base import BaseCommand, CommandParser
|
||||||
|
|
||||||
|
|
||||||
@@ -26,26 +26,17 @@ class Command(BaseCommand):
|
|||||||
ignore_patterns: Any = ...
|
ignore_patterns: Any = ...
|
||||||
post_process: Any = ...
|
post_process: Any = ...
|
||||||
def set_options(self, **options: Any) -> None: ...
|
def set_options(self, **options: Any) -> None: ...
|
||||||
def collect(self) -> Union[str, List[str]]: ...
|
def collect(self) -> Dict[str, List[str]]: ...
|
||||||
def handle(self, **options: Any) -> Optional[str]: ...
|
def handle(self, **options: Any) -> Optional[str]: ...
|
||||||
def log(self, msg: str, level: int = ...) -> None: ...
|
def log(self, msg: str, level: int = ...) -> None: ...
|
||||||
def is_local_storage(self) -> bool: ...
|
def is_local_storage(self) -> bool: ...
|
||||||
def clear_dir(self, path: str) -> None: ...
|
def clear_dir(self, path: str) -> None: ...
|
||||||
def delete_file(
|
def delete_file(
|
||||||
self,
|
self, path: str, prefixed_path: str, source_storage: FileSystemStorage
|
||||||
path: str,
|
|
||||||
prefixed_path: str,
|
|
||||||
source_storage: Union[DefaultStorage, FileSystemStorage],
|
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
def link_file(
|
def link_file(
|
||||||
self,
|
self, path: str, prefixed_path: str, source_storage: FileSystemStorage
|
||||||
path: str,
|
|
||||||
prefixed_path: str,
|
|
||||||
source_storage: Union[DefaultStorage, FileSystemStorage],
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def copy_file(
|
def copy_file(
|
||||||
self,
|
self, path: str, prefixed_path: str, source_storage: FileSystemStorage
|
||||||
path: str,
|
|
||||||
prefixed_path: str,
|
|
||||||
source_storage: Union[DefaultStorage, FileSystemStorage],
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from typing import Any, Iterator, List, Optional, Tuple, Union
|
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(
|
def matches_patterns(
|
||||||
path: str, patterns: Union[OrderedDict, List[str], Tuple[str]] = ...
|
path: str, patterns: Union[List[str], Tuple[str], OrderedDict] = ...
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
def get_files(
|
def get_files(
|
||||||
storage: Union[DefaultStorage, FileSystemStorage],
|
storage: FileSystemStorage,
|
||||||
ignore_patterns: List[str] = ...,
|
ignore_patterns: List[str] = ...,
|
||||||
location: str = ...,
|
location: str = ...,
|
||||||
) -> Iterator[str]: ...
|
) -> Iterator[str]: ...
|
||||||
|
|||||||
0
django-stubs/contrib/syndication/__init__.pyi
Normal file
0
django-stubs/contrib/syndication/__init__.pyi
Normal file
0
django-stubs/core/__init__.pyi
Normal file
0
django-stubs/core/__init__.pyi
Normal file
2
django-stubs/core/cache/__init__.pyi
vendored
2
django-stubs/core/cache/__init__.pyi
vendored
@@ -16,7 +16,7 @@ class CacheHandler:
|
|||||||
class DefaultCacheProxy:
|
class DefaultCacheProxy:
|
||||||
def __getattr__(
|
def __getattr__(
|
||||||
self, name: str
|
self, name: str
|
||||||
) -> Union[Callable, Dict[str, float], int, OrderedDict]: ...
|
) -> Union[Callable, Dict[str, float], OrderedDict, int]: ...
|
||||||
def __setattr__(self, name: str, value: Callable) -> None: ...
|
def __setattr__(self, name: str, value: Callable) -> None: ...
|
||||||
def __delattr__(self, name: Any): ...
|
def __delattr__(self, name: Any): ...
|
||||||
def __contains__(self, key: str) -> bool: ...
|
def __contains__(self, key: str) -> bool: ...
|
||||||
|
|||||||
0
django-stubs/core/cache/backends/__init__.pyi
vendored
Normal file
0
django-stubs/core/cache/backends/__init__.pyi
vendored
Normal file
17
django-stubs/core/cache/backends/base.pyi
vendored
17
django-stubs/core/cache/backends/base.pyi
vendored
@@ -11,7 +11,7 @@ DEFAULT_TIMEOUT: Any
|
|||||||
MEMCACHE_MAX_KEY_LENGTH: int
|
MEMCACHE_MAX_KEY_LENGTH: int
|
||||||
|
|
||||||
def default_key_func(
|
def default_key_func(
|
||||||
key: Union[str, int], key_prefix: str, version: Union[str, int]
|
key: Union[int, str], key_prefix: str, version: Union[int, str]
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def get_key_func(key_func: Optional[Union[Callable, str]]) -> Callable: ...
|
def get_key_func(key_func: Optional[Union[Callable, str]]) -> Callable: ...
|
||||||
|
|
||||||
@@ -22,11 +22,11 @@ class BaseCache:
|
|||||||
key_func: Callable = ...
|
key_func: Callable = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
params: Dict[str, Optional[Union[Dict[str, int], Callable, str, int]]],
|
params: Dict[str, Optional[Union[Callable, Dict[str, int], int, str]]],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_backend_timeout(self, timeout: Any = ...) -> Optional[float]: ...
|
def get_backend_timeout(self, timeout: Any = ...) -> Optional[float]: ...
|
||||||
def make_key(
|
def make_key(
|
||||||
self, key: Union[str, int], version: Optional[Union[str, int]] = ...
|
self, key: Union[int, str], version: Optional[Union[int, str]] = ...
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def add(
|
def add(
|
||||||
self,
|
self,
|
||||||
@@ -54,14 +54,14 @@ class BaseCache:
|
|||||||
def delete(self, key: Any, version: Optional[Any] = ...) -> None: ...
|
def delete(self, key: Any, version: Optional[Any] = ...) -> None: ...
|
||||||
def get_many(
|
def get_many(
|
||||||
self, keys: List[str], version: Optional[int] = ...
|
self, keys: List[str], version: Optional[int] = ...
|
||||||
) -> Dict[str, Union[str, int]]: ...
|
) -> Dict[str, Union[int, str]]: ...
|
||||||
def get_or_set(
|
def get_or_set(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
default: Optional[Union[Callable, int, str]],
|
default: Optional[Union[Callable, int, str]],
|
||||||
timeout: Any = ...,
|
timeout: Any = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> Optional[Union[str, int]]: ...
|
) -> Optional[Union[int, str]]: ...
|
||||||
def has_key(self, key: Any, version: Optional[Any] = ...): ...
|
def has_key(self, key: Any, version: Optional[Any] = ...): ...
|
||||||
def incr(
|
def incr(
|
||||||
self, key: str, delta: int = ..., version: Optional[int] = ...
|
self, key: str, delta: int = ..., version: Optional[int] = ...
|
||||||
@@ -73,13 +73,10 @@ class BaseCache:
|
|||||||
def set_many(
|
def set_many(
|
||||||
self,
|
self,
|
||||||
data: Union[
|
data: Union[
|
||||||
Dict[str, bytes],
|
Dict[str, bytes], Dict[str, int], Dict[str, str], OrderedDict
|
||||||
Dict[str, Union[Dict[str, int], str]],
|
|
||||||
Dict[str, int],
|
|
||||||
OrderedDict,
|
|
||||||
],
|
],
|
||||||
timeout: Any = ...,
|
timeout: Any = ...,
|
||||||
version: Optional[Union[str, int]] = ...,
|
version: Optional[Union[int, str]] = ...,
|
||||||
) -> List[Any]: ...
|
) -> List[Any]: ...
|
||||||
def delete_many(
|
def delete_many(
|
||||||
self, keys: Union[Dict[str, str], List[str]], version: None = ...
|
self, keys: Union[Dict[str, str], List[str]], version: None = ...
|
||||||
|
|||||||
6
django-stubs/core/cache/backends/db.pyi
vendored
6
django-stubs/core/cache/backends/db.pyi
vendored
@@ -25,7 +25,7 @@ class BaseDatabaseCache(BaseCache):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
table: str,
|
table: str,
|
||||||
params: Dict[str, Union[Dict[str, int], Callable, str, int]],
|
params: Dict[str, Union[Callable, Dict[str, int], int, str]],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
class DatabaseCache(BaseDatabaseCache):
|
class DatabaseCache(BaseDatabaseCache):
|
||||||
@@ -36,7 +36,7 @@ class DatabaseCache(BaseDatabaseCache):
|
|||||||
def get(
|
def get(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
default: Optional[Union[str, int]] = ...,
|
default: Optional[Union[int, str]] = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> Any: ...
|
) -> Any: ...
|
||||||
def set(
|
def set(
|
||||||
@@ -49,7 +49,7 @@ class DatabaseCache(BaseDatabaseCache):
|
|||||||
def add(
|
def add(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
value: Union[int, bytes, str, Dict[str, int]],
|
value: Union[Dict[str, int], bytes, int, str],
|
||||||
timeout: Any = ...,
|
timeout: Any = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
|
|||||||
19
django-stubs/core/cache/backends/dummy.pyi
vendored
19
django-stubs/core/cache/backends/dummy.pyi
vendored
@@ -1,4 +1,4 @@
|
|||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Dict, Optional, Union
|
||||||
|
|
||||||
from django.core.cache.backends.base import BaseCache
|
from django.core.cache.backends.base import BaseCache
|
||||||
|
|
||||||
@@ -21,22 +21,7 @@ class DummyCache(BaseCache):
|
|||||||
def set(
|
def set(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
value: Union[
|
value: Union[Dict[str, Any], int, str],
|
||||||
str,
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
str,
|
|
||||||
int,
|
|
||||||
List[int],
|
|
||||||
Tuple[int, int, int, int],
|
|
||||||
Dict[str, int],
|
|
||||||
Callable,
|
|
||||||
Type[Any],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
timeout: Any = ...,
|
timeout: Any = ...,
|
||||||
version: Optional[str] = ...,
|
version: Optional[str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
@@ -12,19 +12,19 @@ class FileBasedCache(BaseCache):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
dir: str,
|
dir: str,
|
||||||
params: Dict[str, Union[Dict[str, int], Callable, str, int]],
|
params: Dict[str, Union[Callable, Dict[str, int], int, str]],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def add(
|
def add(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
value: Union[int, bytes, str, Dict[str, int]],
|
value: Union[Dict[str, int], bytes, int, str],
|
||||||
timeout: Any = ...,
|
timeout: Any = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
def get(
|
def get(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
default: Optional[Union[str, int]] = ...,
|
default: Optional[Union[int, str]] = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> Optional[str]: ...
|
) -> Optional[str]: ...
|
||||||
def set(
|
def set(
|
||||||
|
|||||||
15
django-stubs/core/cache/backends/locmem.pyi
vendored
15
django-stubs/core/cache/backends/locmem.pyi
vendored
@@ -1,4 +1,3 @@
|
|||||||
from datetime import datetime
|
|
||||||
from typing import Any, Callable, Dict, Optional, Union
|
from typing import Any, Callable, Dict, Optional, Union
|
||||||
|
|
||||||
from django.core.cache.backends.base import BaseCache
|
from django.core.cache.backends.base import BaseCache
|
||||||
@@ -12,26 +11,24 @@ class LocMemCache(BaseCache):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
name: str,
|
name: str,
|
||||||
params: Dict[str, Optional[Union[Dict[str, int], Callable, str, int]]],
|
params: Dict[str, Optional[Union[Callable, Dict[str, int], int, str]]],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def add(
|
def add(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
value: Union[
|
value: Union[Dict[str, int], Dict[str, str], bytes, int, str],
|
||||||
Dict[str, Union[str, datetime]], int, bytes, str, Dict[str, int]
|
|
||||||
],
|
|
||||||
timeout: Any = ...,
|
timeout: Any = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> Any: ...
|
) -> Any: ...
|
||||||
def get(
|
def get(
|
||||||
self,
|
self,
|
||||||
key: Union[str, int],
|
key: Union[int, str],
|
||||||
default: Optional[Union[str, int]] = ...,
|
default: Optional[Union[int, str]] = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> Any: ...
|
) -> Any: ...
|
||||||
def set(
|
def set(
|
||||||
self,
|
self,
|
||||||
key: Union[str, int],
|
key: Union[int, str],
|
||||||
value: Any,
|
value: Any,
|
||||||
timeout: Any = ...,
|
timeout: Any = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
@@ -41,7 +38,7 @@ class LocMemCache(BaseCache):
|
|||||||
) -> Any: ...
|
) -> Any: ...
|
||||||
def incr(
|
def incr(
|
||||||
self,
|
self,
|
||||||
key: Union[str, int],
|
key: Union[int, str],
|
||||||
delta: int = ...,
|
delta: int = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> int: ...
|
) -> int: ...
|
||||||
|
|||||||
0
django-stubs/core/checks/__init__.pyi
Normal file
0
django-stubs/core/checks/__init__.pyi
Normal file
@@ -20,7 +20,7 @@ class CheckMessage:
|
|||||||
obj: Any = ...,
|
obj: Any = ...,
|
||||||
id: Optional[str] = ...,
|
id: Optional[str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __eq__(self, other: Union[str, CheckMessage]) -> bool: ...
|
def __eq__(self, other: Union[CheckMessage, str]) -> bool: ...
|
||||||
def is_serious(self, level: int = ...) -> bool: ...
|
def is_serious(self, level: int = ...) -> bool: ...
|
||||||
def is_silenced(self) -> bool: ...
|
def is_silenced(self) -> bool: ...
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class CheckRegistry:
|
|||||||
app_configs: Optional[List[AppConfig]] = ...,
|
app_configs: Optional[List[AppConfig]] = ...,
|
||||||
tags: Optional[List[str]] = ...,
|
tags: Optional[List[str]] = ...,
|
||||||
include_deployment_checks: bool = ...,
|
include_deployment_checks: bool = ...,
|
||||||
) -> Union[List[int], List[CheckMessage], List[str]]: ...
|
) -> Union[List[CheckMessage], List[int], List[str]]: ...
|
||||||
def tag_exists(
|
def tag_exists(
|
||||||
self, tag: str, include_deployment_checks: bool = ...
|
self, tag: str, include_deployment_checks: bool = ...
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
|
|||||||
0
django-stubs/core/checks/security/__init__.pyi
Normal file
0
django-stubs/core/checks/security/__init__.pyi
Normal file
@@ -8,7 +8,7 @@ def check_url_config(
|
|||||||
app_configs: None, **kwargs: Any
|
app_configs: None, **kwargs: Any
|
||||||
) -> List[CheckMessage]: ...
|
) -> List[CheckMessage]: ...
|
||||||
def check_resolver(
|
def check_resolver(
|
||||||
resolver: Union[URLResolver, Tuple[str, Callable], URLPattern]
|
resolver: Union[Tuple[str, Callable], URLPattern, URLResolver]
|
||||||
) -> List[CheckMessage]: ...
|
) -> List[CheckMessage]: ...
|
||||||
def check_url_namespaces_unique(
|
def check_url_namespaces_unique(
|
||||||
app_configs: None, **kwargs: Any
|
app_configs: None, **kwargs: Any
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
from typing import (Any, Dict, Iterable, Iterator, List, Optional, Tuple, Type,
|
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
|
||||||
Union)
|
|
||||||
|
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.forms.utils import ErrorDict
|
from django.forms.utils import ErrorDict, ErrorList
|
||||||
|
|
||||||
|
|
||||||
class FieldDoesNotExist(Exception): ...
|
class FieldDoesNotExist(Exception): ...
|
||||||
@@ -35,12 +34,19 @@ class ValidationError(Exception):
|
|||||||
params: Any = ...
|
params: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
message: Iterable,
|
message: Union[
|
||||||
|
Dict[str, List[ValidationError]],
|
||||||
|
Dict[str, ErrorList],
|
||||||
|
List[Union[ValidationError, str]],
|
||||||
|
ValidationError,
|
||||||
|
ErrorList,
|
||||||
|
str,
|
||||||
|
],
|
||||||
code: Optional[str] = ...,
|
code: Optional[str] = ...,
|
||||||
params: Optional[
|
params: Optional[
|
||||||
Union[
|
Union[
|
||||||
|
Dict[str, Union[Tuple[str], Type[Model], Model, str]],
|
||||||
Dict[str, Union[int, str]],
|
Dict[str, Union[int, str]],
|
||||||
Dict[str, Union[Model, Type[Model], str, Tuple[str]]],
|
|
||||||
]
|
]
|
||||||
] = ...,
|
] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@@ -51,6 +57,6 @@ class ValidationError(Exception):
|
|||||||
def update_error_dict(
|
def update_error_dict(
|
||||||
self, error_dict: Union[Dict[str, List[ValidationError]], ErrorDict]
|
self, error_dict: Union[Dict[str, List[ValidationError]], ErrorDict]
|
||||||
) -> Union[Dict[str, List[ValidationError]], ErrorDict]: ...
|
) -> Union[Dict[str, List[ValidationError]], ErrorDict]: ...
|
||||||
def __iter__(self) -> Iterator[Union[str, Tuple[str, List[str]]]]: ...
|
def __iter__(self) -> Iterator[Union[Tuple[str, List[str]], str]]: ...
|
||||||
|
|
||||||
class EmptyResultSet(Exception): ...
|
class EmptyResultSet(Exception): ...
|
||||||
|
|||||||
0
django-stubs/core/files/__init__.pyi
Normal file
0
django-stubs/core/files/__init__.pyi
Normal file
@@ -14,9 +14,9 @@ class File(FileProxyMixin):
|
|||||||
def size(self) -> int: ...
|
def size(self) -> int: ...
|
||||||
def chunks(
|
def chunks(
|
||||||
self, chunk_size: Optional[int] = ...
|
self, chunk_size: Optional[int] = ...
|
||||||
) -> Iterator[Union[str, bytes]]: ...
|
) -> Iterator[Union[bytes, str]]: ...
|
||||||
def multiple_chunks(self, chunk_size: Optional[Any] = ...): ...
|
def multiple_chunks(self, chunk_size: Optional[Any] = ...): ...
|
||||||
def __iter__(self) -> Iterator[Union[str, bytes]]: ...
|
def __iter__(self) -> Iterator[Union[bytes, str]]: ...
|
||||||
def __enter__(self) -> File: ...
|
def __enter__(self) -> File: ...
|
||||||
def __exit__(self, exc_type: None, exc_value: None, tb: None) -> None: ...
|
def __exit__(self, exc_type: None, exc_value: None, tb: None) -> None: ...
|
||||||
def open(self, mode: Optional[str] = ...) -> File: ...
|
def open(self, mode: Optional[str] = ...) -> File: ...
|
||||||
@@ -27,7 +27,7 @@ class ContentFile(File):
|
|||||||
name: None
|
name: None
|
||||||
size: Any = ...
|
size: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self, content: Union[str, bytes], name: Optional[str] = ...
|
self, content: Union[bytes, str], name: Optional[str] = ...
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __bool__(self) -> bool: ...
|
def __bool__(self) -> bool: ...
|
||||||
def open(self, mode: Optional[str] = ...) -> ContentFile: ...
|
def open(self, mode: Optional[str] = ...) -> ContentFile: ...
|
||||||
@@ -35,5 +35,5 @@ class ContentFile(File):
|
|||||||
def write(self, data: str) -> int: ...
|
def write(self, data: str) -> int: ...
|
||||||
|
|
||||||
def endswith_cr(line: bytes) -> bool: ...
|
def endswith_cr(line: bytes) -> bool: ...
|
||||||
def endswith_lf(line: Union[str, bytes]) -> bool: ...
|
def endswith_lf(line: Union[bytes, str]) -> bool: ...
|
||||||
def equals_lf(line: bytes) -> bool: ...
|
def equals_lf(line: bytes) -> bool: ...
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ class ImageFile(File):
|
|||||||
def height(self) -> int: ...
|
def height(self) -> int: ...
|
||||||
|
|
||||||
def get_image_dimensions(
|
def get_image_dimensions(
|
||||||
file_or_path: Union[BytesIO, BufferedReader, str, ImageFile],
|
file_or_path: Union[BufferedReader, BytesIO, ImageFile, str],
|
||||||
close: bool = ...,
|
close: bool = ...,
|
||||||
) -> Any: ...
|
) -> Any: ...
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ class _OFFSET(Structure): ...
|
|||||||
class _OFFSET_UNION(Union): ...
|
class _OFFSET_UNION(Union): ...
|
||||||
class OVERLAPPED(Structure): ...
|
class OVERLAPPED(Structure): ...
|
||||||
|
|
||||||
def lock(f: Union[TextIOWrapper, BufferedRandom, int], flags: int) -> bool: ...
|
def lock(f: Union[BufferedRandom, TextIOWrapper, int], flags: int) -> bool: ...
|
||||||
def unlock(f: Union[BufferedRandom, int]) -> bool: ...
|
def unlock(f: Union[BufferedRandom, int]) -> bool: ...
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class Storage:
|
|||||||
def save(
|
def save(
|
||||||
self,
|
self,
|
||||||
name: Optional[str],
|
name: Optional[str],
|
||||||
content: Union[TextIOWrapper, StringIO, File],
|
content: Union[StringIO, TextIOWrapper, File],
|
||||||
max_length: Optional[int] = ...,
|
max_length: Optional[int] = ...,
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def get_valid_name(self, name: str) -> str: ...
|
def get_valid_name(self, name: str) -> str: ...
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class UploadedFile(File):
|
|||||||
content_type_extra: Any = ...
|
content_type_extra: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
file: Optional[Union[_TemporaryFileWrapper, StringIO, BytesIO]] = ...,
|
file: Optional[Union[BytesIO, StringIO, _TemporaryFileWrapper]] = ...,
|
||||||
name: str = ...,
|
name: str = ...,
|
||||||
content_type: str = ...,
|
content_type: str = ...,
|
||||||
size: Optional[int] = ...,
|
size: Optional[int] = ...,
|
||||||
@@ -41,7 +41,7 @@ class InMemoryUploadedFile(UploadedFile):
|
|||||||
field_name: Any = ...
|
field_name: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
file: Union[StringIO, BytesIO],
|
file: Union[BytesIO, StringIO],
|
||||||
field_name: Optional[str],
|
field_name: Optional[str],
|
||||||
name: str,
|
name: str,
|
||||||
content_type: str,
|
content_type: str,
|
||||||
@@ -50,7 +50,7 @@ class InMemoryUploadedFile(UploadedFile):
|
|||||||
content_type_extra: Optional[Dict[str, bytes]] = ...,
|
content_type_extra: Optional[Dict[str, bytes]] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def open(self, mode: Optional[str] = ...) -> InMemoryUploadedFile: ...
|
def open(self, mode: Optional[str] = ...) -> InMemoryUploadedFile: ...
|
||||||
def chunks(self, chunk_size: None = ...) -> Iterator[Union[str, bytes]]: ...
|
def chunks(self, chunk_size: None = ...) -> Iterator[Union[bytes, str]]: ...
|
||||||
def multiple_chunks(self, chunk_size: Optional[Any] = ...): ...
|
def multiple_chunks(self, chunk_size: Optional[Any] = ...): ...
|
||||||
|
|
||||||
class SimpleUploadedFile(InMemoryUploadedFile):
|
class SimpleUploadedFile(InMemoryUploadedFile):
|
||||||
@@ -58,7 +58,7 @@ class SimpleUploadedFile(InMemoryUploadedFile):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
name: str,
|
name: str,
|
||||||
content: Optional[Union[str, bytes]],
|
content: Optional[Union[bytes, str]],
|
||||||
content_type: str = ...,
|
content_type: str = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class FileUploadHandler:
|
|||||||
def __init__(self, request: Optional[WSGIRequest] = ...) -> None: ...
|
def __init__(self, request: Optional[WSGIRequest] = ...) -> None: ...
|
||||||
def handle_raw_input(
|
def handle_raw_input(
|
||||||
self,
|
self,
|
||||||
input_data: Union[WSGIRequest, BytesIO],
|
input_data: Union[BytesIO, WSGIRequest],
|
||||||
META: Dict[str, Any],
|
META: Dict[str, Any],
|
||||||
content_length: int,
|
content_length: int,
|
||||||
boundary: bytes,
|
boundary: bytes,
|
||||||
@@ -68,7 +68,7 @@ class MemoryFileUploadHandler(FileUploadHandler):
|
|||||||
activated: Any = ...
|
activated: Any = ...
|
||||||
def handle_raw_input(
|
def handle_raw_input(
|
||||||
self,
|
self,
|
||||||
input_data: Union[WSGIRequest, BytesIO],
|
input_data: Union[BytesIO, WSGIRequest],
|
||||||
META: Dict[str, Any],
|
META: Dict[str, Any],
|
||||||
content_length: int,
|
content_length: int,
|
||||||
boundary: bytes,
|
boundary: bytes,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user