mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-07 04:34:29 +08:00
better stubs
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
# Stubs for django (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
|
||||
VERSION: Any
|
||||
__version__: Any
|
||||
|
||||
def setup(set_prefix: bool = ...) -> None: ...
|
||||
|
||||
@@ -1,29 +1,24 @@
|
||||
# Stubs for django.apps.config (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Iterator, Optional, Type
|
||||
|
||||
from django.db.models.base import Model
|
||||
from typing import Any, Iterator, Type
|
||||
|
||||
MODELS_MODULE_NAME: str
|
||||
|
||||
class AppConfig:
|
||||
name: Any = ...
|
||||
name: str = ...
|
||||
module: Any = ...
|
||||
apps: Any = ...
|
||||
label: Any = ...
|
||||
verbose_name: Any = ...
|
||||
path: Any = ...
|
||||
models_module: Any = ...
|
||||
models: Any = ...
|
||||
def __init__(self, app_name: str, app_module: Any) -> None: ...
|
||||
def __repr__(self): ...
|
||||
def _path_from_module(self, module: Any) -> str: ...
|
||||
apps: None = ...
|
||||
label: str = ...
|
||||
verbose_name: str = ...
|
||||
path: str = ...
|
||||
models_module: None = ...
|
||||
models: None = ...
|
||||
def __init__(self, app_name: str, app_module: None) -> None: ...
|
||||
@classmethod
|
||||
def create(cls, entry: str) -> AppConfig: ...
|
||||
def get_model(self, model_name: str, require_ready: bool = ...) -> Type[Model]: ...
|
||||
def get_model(
|
||||
self, model_name: str, require_ready: bool = ...
|
||||
) -> Type[Model]: ...
|
||||
def get_models(
|
||||
self, include_auto_created: bool = ..., include_swapped: bool = ...
|
||||
) -> Iterator[Type[Model]]: ...
|
||||
|
||||
@@ -1,48 +1,57 @@
|
||||
# Stubs for django.apps.registry (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .config import AppConfig
|
||||
from typing import Any, Optional
|
||||
from functools import partial
|
||||
from typing import Any, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
from django.db.migrations.state import AppConfigStub
|
||||
from django.db.models.base import Model
|
||||
from typing import List, Optional, Tuple, Type, Union
|
||||
|
||||
from .config import AppConfig
|
||||
|
||||
|
||||
class Apps:
|
||||
all_models: Any = ...
|
||||
app_configs: Any = ...
|
||||
stored_app_configs: Any = ...
|
||||
all_models: collections.defaultdict = ...
|
||||
app_configs: collections.OrderedDict = ...
|
||||
stored_app_configs: List[Any] = ...
|
||||
apps_ready: bool = ...
|
||||
_lock: Any = ...
|
||||
loading: bool = ...
|
||||
_pending_operations: Any = ...
|
||||
def __init__(
|
||||
self, installed_apps: Union[Tuple, List[str], List[AppConfigStub]] = ...
|
||||
self, installed_apps: Union[List[AppConfigStub], Tuple] = ...
|
||||
) -> None: ...
|
||||
models_ready: bool = ...
|
||||
ready: bool = ...
|
||||
def populate(self, installed_apps: Optional[Any] = ...): ...
|
||||
def populate(
|
||||
self, installed_apps: Union[List[AppConfigStub], Tuple, List[str]] = ...
|
||||
) -> None: ...
|
||||
def check_apps_ready(self) -> None: ...
|
||||
def check_models_ready(self) -> None: ...
|
||||
def get_app_configs(self): ...
|
||||
def get_app_config(self, app_label: str) -> AppConfig: ...
|
||||
def get_models(self, include_auto_created: bool = ..., include_swapped: bool = ...): ...
|
||||
def get_models(
|
||||
self, include_auto_created: bool = ..., include_swapped: bool = ...
|
||||
) -> List[Type[Model]]: ...
|
||||
def get_model(
|
||||
self, app_label: str, model_name: None = ..., require_ready: bool = ...
|
||||
self,
|
||||
app_label: str,
|
||||
model_name: Optional[str] = ...,
|
||||
require_ready: bool = ...,
|
||||
) -> Type[Model]: ...
|
||||
def register_model(self, app_label: Any, model: Any) -> None: ...
|
||||
def register_model(self, app_label: str, model: Type[Model]) -> None: ...
|
||||
def is_installed(self, app_name: Any): ...
|
||||
def get_containing_app_config(self, object_name: str) -> Optional[AppConfig]: ...
|
||||
def get_registered_model(self, app_label: Any, model_name: Any): ...
|
||||
def get_swappable_settings_name(self, to_string: Any): ...
|
||||
def get_containing_app_config(
|
||||
self, object_name: str
|
||||
) -> Optional[AppConfig]: ...
|
||||
def get_registered_model(
|
||||
self, app_label: str, model_name: str
|
||||
) -> Type[Model]: ...
|
||||
def get_swappable_settings_name(self, to_string: str) -> Optional[str]: ...
|
||||
def set_available_apps(self, available: Any) -> None: ...
|
||||
def unset_available_apps(self) -> None: ...
|
||||
def set_installed_apps(self, installed: Any) -> None: ...
|
||||
def set_installed_apps(self, installed: List[str]) -> None: ...
|
||||
def unset_installed_apps(self) -> None: ...
|
||||
def clear_cache(self) -> None: ...
|
||||
def lazy_model_operation(self, function: Any, *model_keys: Any) -> None: ...
|
||||
def lazy_model_operation(
|
||||
self, function: partial, *model_keys: Any
|
||||
) -> None: ...
|
||||
def do_pending_operations(self, model: Type[Model]) -> None: ...
|
||||
|
||||
apps: Any
|
||||
|
||||
@@ -1,42 +1,36 @@
|
||||
# Stubs for django.conf (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, List, Optional, Union
|
||||
|
||||
from django.utils.functional import LazyObject
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, List
|
||||
|
||||
ENVIRONMENT_VARIABLE: str
|
||||
|
||||
class LazySettings(LazyObject):
|
||||
_wrapped: Any = ...
|
||||
def _setup(self, name: None = ...) -> None: ...
|
||||
def __repr__(self): ...
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: object) -> None: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
def configure(self, default_settings: Any = ..., **options: Any) -> None: ...
|
||||
def configure(self, default_settings: Any = ..., **options: Any) -> Any: ...
|
||||
@property
|
||||
def configured(self) -> bool: ...
|
||||
|
||||
class Settings:
|
||||
FORCE_SCRIPT_NAME: None
|
||||
INSTALLED_APPS: List[Any]
|
||||
LOGGING: Dict[Any, Any]
|
||||
LOGGING_CONFIG: str
|
||||
SETTINGS_MODULE: Any = ...
|
||||
_explicit_settings: Any = ...
|
||||
def __init__(self, settings_module: str) -> None: ...
|
||||
def is_overridden(self, setting: str) -> bool: ...
|
||||
def __repr__(self): ...
|
||||
|
||||
class UserSettingsHolder:
|
||||
SETTINGS_MODULE: Any = ...
|
||||
default_settings: Any = ...
|
||||
def __init__(self, default_settings: Any) -> None: ...
|
||||
default_settings: django.conf.Settings = ...
|
||||
def __init__(
|
||||
self, default_settings: Union[Settings, UserSettingsHolder]
|
||||
) -> None: ...
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
def __dir__(self) -> List[str]: ...
|
||||
def is_overridden(self, setting: Any): ...
|
||||
def __repr__(self): ...
|
||||
def is_overridden(self, setting: str) -> bool: ...
|
||||
|
||||
settings = LazySettings()
|
||||
settings: Any
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
# Stubs for django.conf.urls (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Callable, Optional, Tuple, Union
|
||||
|
||||
from django.urls import include as include
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
handler400: Any
|
||||
handler403: Any
|
||||
@@ -14,5 +9,10 @@ handler404: Any
|
||||
handler500: Any
|
||||
|
||||
def url(
|
||||
regex: str, view: Any, kwargs: Any = ..., name: Optional[str] = ...
|
||||
) -> Union[URLPattern, URLResolver]: ...
|
||||
regex: str,
|
||||
view: Optional[
|
||||
Union[Tuple[None, None, None], Tuple[str, str, str], Callable]
|
||||
],
|
||||
kwargs: Any = ...,
|
||||
name: Optional[str] = ...,
|
||||
) -> Union[URLResolver, URLPattern]: ...
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
# Stubs for django.conf.urls.i18n (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
|
||||
from typing import Any
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
|
||||
from django.urls.resolvers import URLResolver
|
||||
from typing import Any, List, Tuple, Union
|
||||
|
||||
def i18n_patterns(
|
||||
*urls: Any, prefix_default_language: bool = ...
|
||||
) -> Union[List[URLResolver], List[List[Any]]]: ...
|
||||
) -> Union[List[URLPattern], List[List[Any]], List[URLResolver]]: ...
|
||||
def is_language_prefix_patterns_used(urlconf: str) -> Tuple[bool, bool]: ...
|
||||
|
||||
urlpatterns: Any
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Stubs for django.conf.urls.static (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Callable, List, Optional
|
||||
|
||||
from django.urls.resolvers import URLPattern
|
||||
from typing import Callable, List
|
||||
|
||||
def static(prefix: str, view: Callable = ..., **kwargs: Any) -> List[URLPattern]: ...
|
||||
|
||||
def static(
|
||||
prefix: str, view: Callable = ..., **kwargs: Any
|
||||
) -> List[URLPattern]: ...
|
||||
|
||||
@@ -1,27 +1,30 @@
|
||||
# Stubs for django.contrib.admin (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Optional
|
||||
|
||||
from django.contrib.admin.decorators import register as register
|
||||
from django.contrib.admin.filters import (
|
||||
AllValuesFieldListFilter as AllValuesFieldListFilter,
|
||||
BooleanFieldListFilter as BooleanFieldListFilter,
|
||||
ChoicesFieldListFilter as ChoicesFieldListFilter,
|
||||
DateFieldListFilter as DateFieldListFilter,
|
||||
FieldListFilter as FieldListFilter,
|
||||
ListFilter as ListFilter,
|
||||
RelatedFieldListFilter as RelatedFieldListFilter,
|
||||
RelatedOnlyFieldListFilter as RelatedOnlyFieldListFilter,
|
||||
SimpleListFilter as SimpleListFilter,
|
||||
)
|
||||
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME as ACTION_CHECKBOX_NAME
|
||||
from django.contrib.admin.options import (
|
||||
HORIZONTAL as HORIZONTAL,
|
||||
ModelAdmin as ModelAdmin,
|
||||
StackedInline as StackedInline,
|
||||
TabularInline as TabularInline,
|
||||
VERTICAL as VERTICAL,
|
||||
)
|
||||
from django.contrib.admin.sites import AdminSite as AdminSite, site as site
|
||||
from django.contrib.admin.filters import \
|
||||
AllValuesFieldListFilter as AllValuesFieldListFilter
|
||||
from django.contrib.admin.filters import \
|
||||
BooleanFieldListFilter as BooleanFieldListFilter
|
||||
from django.contrib.admin.filters import \
|
||||
ChoicesFieldListFilter as ChoicesFieldListFilter
|
||||
from django.contrib.admin.filters import \
|
||||
DateFieldListFilter as DateFieldListFilter
|
||||
from django.contrib.admin.filters import FieldListFilter as FieldListFilter
|
||||
from django.contrib.admin.filters import ListFilter as ListFilter
|
||||
from django.contrib.admin.filters import \
|
||||
RelatedFieldListFilter as RelatedFieldListFilter
|
||||
from django.contrib.admin.filters import \
|
||||
RelatedOnlyFieldListFilter as RelatedOnlyFieldListFilter
|
||||
from django.contrib.admin.filters import SimpleListFilter as SimpleListFilter
|
||||
from django.contrib.admin.helpers import \
|
||||
ACTION_CHECKBOX_NAME as ACTION_CHECKBOX_NAME
|
||||
from django.contrib.admin.options import HORIZONTAL as HORIZONTAL
|
||||
from django.contrib.admin.options import VERTICAL as VERTICAL
|
||||
from django.contrib.admin.options import ModelAdmin as ModelAdmin
|
||||
from django.contrib.admin.options import StackedInline as StackedInline
|
||||
from django.contrib.admin.options import TabularInline as TabularInline
|
||||
from django.contrib.admin.sites import AdminSite as AdminSite
|
||||
from django.contrib.admin.sites import site as site
|
||||
|
||||
|
||||
def autodiscover() -> None: ...
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
# Stubs for django.contrib.admin.actions (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.admin.options import ModelAdmin
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.query import QuerySet
|
||||
from django.template.response import TemplateResponse
|
||||
|
||||
|
||||
def delete_selected(
|
||||
modeladmin: ModelAdmin, request: WSGIRequest, queryset: QuerySet
|
||||
) -> TemplateResponse: ...
|
||||
) -> Optional[TemplateResponse]: ...
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
# Stubs for django.contrib.admin.apps (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.apps import AppConfig
|
||||
from typing import Any
|
||||
|
||||
|
||||
class SimpleAdminConfig(AppConfig):
|
||||
apps: None
|
||||
label: str
|
||||
models: None
|
||||
models_module: None
|
||||
module: Any
|
||||
path: str
|
||||
default_site: str = ...
|
||||
name: str = ...
|
||||
verbose_name: Any = ...
|
||||
def ready(self) -> None: ...
|
||||
|
||||
class AdminConfig(SimpleAdminConfig):
|
||||
apps: None
|
||||
label: str
|
||||
models: None
|
||||
models_module: None
|
||||
module: Any
|
||||
name: str
|
||||
path: str
|
||||
def ready(self) -> None: ...
|
||||
|
||||
@@ -1,159 +1,28 @@
|
||||
# Stubs for django.contrib.admin.checks (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from typing import Any
|
||||
|
||||
from django.contrib.admin.options import InlineModelAdmin, ModelAdmin, TabularInline
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.contrib.admin.options import (BaseModelAdmin, InlineModelAdmin,
|
||||
ModelAdmin)
|
||||
from django.core.checks.messages import Error
|
||||
from django.db.models.base import Model
|
||||
from typing import Any, List, Tuple, Type, Union
|
||||
|
||||
def check_admin_app(app_configs: Any, **kwargs: Any): ...
|
||||
def check_dependencies(**kwargs: Any): ...
|
||||
|
||||
def check_admin_app(app_configs: None, **kwargs: Any) -> List[str]: ...
|
||||
def check_dependencies(**kwargs: Any) -> List[Error]: ...
|
||||
|
||||
class BaseModelAdminChecks:
|
||||
def check(
|
||||
self, admin_obj: Union[ModelAdmin, InlineModelAdmin], **kwargs: Any
|
||||
self, admin_obj: BaseModelAdmin, **kwargs: Any
|
||||
) -> List[Error]: ...
|
||||
def _check_autocomplete_fields(
|
||||
self, obj: Union[ModelAdmin, InlineModelAdmin]
|
||||
) -> List[Any]: ...
|
||||
def _check_autocomplete_fields_item(
|
||||
self,
|
||||
obj: Union[ModelAdmin, InlineModelAdmin],
|
||||
model: Type[Model],
|
||||
field_name: str,
|
||||
label: str,
|
||||
) -> List[Any]: ...
|
||||
def _check_raw_id_fields(
|
||||
self, obj: Union[ModelAdmin, InlineModelAdmin]
|
||||
) -> List[Any]: ...
|
||||
def _check_raw_id_fields_item(
|
||||
self, obj: ModelAdmin, model: Type[Model], field_name: str, label: str
|
||||
) -> List[Any]: ...
|
||||
def _check_fields(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
|
||||
def _check_fieldsets(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
|
||||
def _check_fieldsets_item(
|
||||
self,
|
||||
obj: Union[ModelAdmin, InlineModelAdmin],
|
||||
model: Type[Model],
|
||||
fieldset: Any,
|
||||
label: str,
|
||||
seen_fields: List[str],
|
||||
) -> List[Any]: ...
|
||||
def _check_field_spec(
|
||||
self,
|
||||
obj: Union[ModelAdmin, InlineModelAdmin],
|
||||
model: Type[Model],
|
||||
fields: Union[str, Tuple[str, str, str, str], Tuple[str, str]],
|
||||
label: str,
|
||||
) -> List[Any]: ...
|
||||
def _check_field_spec_item(
|
||||
self,
|
||||
obj: Union[ModelAdmin, TabularInline],
|
||||
model: Type[Model],
|
||||
field_name: str,
|
||||
label: str,
|
||||
) -> List[Any]: ...
|
||||
def _check_exclude(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
|
||||
def _check_form(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
|
||||
def _check_filter_vertical(
|
||||
self, obj: Union[ModelAdmin, InlineModelAdmin]
|
||||
) -> List[Any]: ...
|
||||
def _check_filter_horizontal(
|
||||
self, obj: Union[ModelAdmin, InlineModelAdmin]
|
||||
) -> List[Any]: ...
|
||||
def _check_filter_item(
|
||||
self, obj: ModelAdmin, model: Type[Union[Group, User]], field_name: str, label: str
|
||||
) -> List[Any]: ...
|
||||
def _check_radio_fields(
|
||||
self, obj: Union[ModelAdmin, InlineModelAdmin]
|
||||
) -> List[Any]: ...
|
||||
def _check_radio_fields_key(
|
||||
self, obj: Any, model: Any, field_name: Any, label: Any
|
||||
): ...
|
||||
def _check_radio_fields_value(self, obj: Any, val: Any, label: Any): ...
|
||||
def _check_view_on_site_url(
|
||||
self, obj: Union[ModelAdmin, InlineModelAdmin]
|
||||
) -> List[Any]: ...
|
||||
def _check_prepopulated_fields(
|
||||
self, obj: Union[ModelAdmin, InlineModelAdmin]
|
||||
) -> List[Any]: ...
|
||||
def _check_prepopulated_fields_key(
|
||||
self,
|
||||
obj: Union[ModelAdmin, InlineModelAdmin],
|
||||
model: Type[Model],
|
||||
field_name: str,
|
||||
label: str,
|
||||
) -> List[Any]: ...
|
||||
def _check_prepopulated_fields_value(
|
||||
self,
|
||||
obj: Union[ModelAdmin, InlineModelAdmin],
|
||||
model: Type[Model],
|
||||
val: Union[List[str], Tuple[str]],
|
||||
label: str,
|
||||
) -> List[Any]: ...
|
||||
def _check_prepopulated_fields_value_item(
|
||||
self,
|
||||
obj: Union[ModelAdmin, TabularInline],
|
||||
model: Type[Model],
|
||||
field_name: str,
|
||||
label: str,
|
||||
) -> List[Any]: ...
|
||||
def _check_ordering(self, obj: Union[ModelAdmin, InlineModelAdmin]) -> List[Any]: ...
|
||||
def _check_ordering_item(
|
||||
self, obj: ModelAdmin, model: Type[Model], field_name: str, label: str
|
||||
) -> List[Any]: ...
|
||||
def _check_readonly_fields(
|
||||
self, obj: Union[ModelAdmin, InlineModelAdmin]
|
||||
) -> List[Any]: ...
|
||||
def _check_readonly_fields_item(
|
||||
self,
|
||||
obj: Union[ModelAdmin, TabularInline],
|
||||
model: Type[Model],
|
||||
field_name: str,
|
||||
label: str,
|
||||
) -> List[Any]: ...
|
||||
|
||||
class ModelAdminChecks(BaseModelAdminChecks):
|
||||
def check(self, admin_obj: Any, **kwargs: Any): ...
|
||||
def _check_save_as(self, obj: Any): ...
|
||||
def _check_save_on_top(self, obj: Any): ...
|
||||
def _check_inlines(self, obj: Any): ...
|
||||
def _check_inlines_item(self, obj: Any, model: Any, inline: Any, label: Any): ...
|
||||
def _check_list_display(self, obj: Any): ...
|
||||
def _check_list_display_item(self, obj: Any, model: Any, item: Any, label: Any): ...
|
||||
def _check_list_display_links(self, obj: Any): ...
|
||||
def _check_list_display_links_item(self, obj: Any, field_name: Any, label: Any): ...
|
||||
def _check_list_filter(self, obj: Any): ...
|
||||
def _check_list_filter_item(self, obj: Any, model: Any, item: Any, label: Any): ...
|
||||
def _check_list_select_related(self, obj: Any): ...
|
||||
def _check_list_per_page(self, obj: Any): ...
|
||||
def _check_list_max_show_all(self, obj: Any): ...
|
||||
def _check_list_editable(self, obj: Any): ...
|
||||
def _check_list_editable_item(
|
||||
self, obj: Any, model: Any, field_name: Any, label: Any
|
||||
): ...
|
||||
def _check_search_fields(self, obj: Any): ...
|
||||
def _check_date_hierarchy(self, obj: Any): ...
|
||||
def _check_action_permission_methods(self, obj: Any): ...
|
||||
def check(self, admin_obj: ModelAdmin, **kwargs: Any) -> List[Error]: ...
|
||||
|
||||
class InlineModelAdminChecks(BaseModelAdminChecks):
|
||||
def check(self, inline_obj: Any, **kwargs: Any): ...
|
||||
def _check_exclude_of_parent_model(
|
||||
self, obj: InlineModelAdmin, parent_model: Type[Model]
|
||||
def check(
|
||||
self, inline_obj: InlineModelAdmin, **kwargs: Any
|
||||
) -> List[Any]: ...
|
||||
def _check_relation(
|
||||
self, obj: InlineModelAdmin, parent_model: Type[Model]
|
||||
) -> List[Any]: ...
|
||||
def _check_extra(self, obj: InlineModelAdmin) -> List[Any]: ...
|
||||
def _check_max_num(self, obj: InlineModelAdmin) -> List[Any]: ...
|
||||
def _check_min_num(self, obj: InlineModelAdmin) -> List[Any]: ...
|
||||
def _check_formset(self, obj: InlineModelAdmin) -> List[Any]: ...
|
||||
def _check_has_add_permission(self, obj: InlineModelAdmin) -> None: ...
|
||||
|
||||
def must_be(type: Any, option: Any, obj: Any, id: Any): ...
|
||||
def must_inherit_from(parent: Any, option: Any, obj: Any, id: Any): ...
|
||||
def refer_to_missing_field(field: Any, option: Any, model: Any, obj: Any, id: Any): ...
|
||||
def refer_to_missing_field(
|
||||
field: Any, option: Any, model: Any, obj: Any, id: Any
|
||||
): ...
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
# Stubs for django.contrib.admin.decorators (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Callable
|
||||
|
||||
def register(*models: Any, site: Optional[Any] = ...) -> Callable: ...
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
# Stubs for django.contrib.admin.filters (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.contrib.admin.options import ModelAdmin
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import BooleanField, DateField, Field
|
||||
from django.db.models.fields.related import ForeignKey, ManyToManyField
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.related import RelatedField
|
||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
|
||||
class ListFilter:
|
||||
title: Any = ...
|
||||
@@ -46,14 +43,12 @@ class SimpleListFilter(ListFilter):
|
||||
def choices(self, changelist: Any) -> None: ...
|
||||
|
||||
class FieldListFilter(ListFilter):
|
||||
_field_list_filters: Any = ...
|
||||
_take_priority_index: int = ...
|
||||
field: Any = ...
|
||||
field_path: Any = ...
|
||||
title: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: Union[ForeignObjectRel, Field],
|
||||
field: Union[Field, reverse_related.ForeignObjectRel],
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
@@ -61,18 +56,28 @@ class FieldListFilter(ListFilter):
|
||||
field_path: str,
|
||||
) -> None: ...
|
||||
def has_output(self) -> bool: ...
|
||||
def queryset(self, request: WSGIRequest, queryset: QuerySet) -> QuerySet: ...
|
||||
def queryset(
|
||||
self, request: WSGIRequest, queryset: QuerySet
|
||||
) -> QuerySet: ...
|
||||
@classmethod
|
||||
def register(
|
||||
cls,
|
||||
test: Callable,
|
||||
list_filter_class: Type[FieldListFilter],
|
||||
list_filter_class: Type[
|
||||
Union[
|
||||
BooleanFieldListFilter,
|
||||
AllValuesFieldListFilter,
|
||||
DateFieldListFilter,
|
||||
RelatedFieldListFilter,
|
||||
ChoicesFieldListFilter,
|
||||
]
|
||||
],
|
||||
take_priority: bool = ...,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def create(
|
||||
cls,
|
||||
field: Union[ForeignObjectRel, Field],
|
||||
field: Union[Field, reverse_related.ForeignObjectRel],
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
@@ -81,17 +86,20 @@ class FieldListFilter(ListFilter):
|
||||
) -> FieldListFilter: ...
|
||||
|
||||
class RelatedFieldListFilter(FieldListFilter):
|
||||
lookup_kwarg: Any = ...
|
||||
lookup_kwarg_isnull: Any = ...
|
||||
lookup_val: Any = ...
|
||||
lookup_val_isnull: Any = ...
|
||||
field: django.db.models.fields.related.ForeignKey
|
||||
field_path: str
|
||||
used_parameters: Dict[Any, Any]
|
||||
lookup_kwarg: str = ...
|
||||
lookup_kwarg_isnull: str = ...
|
||||
lookup_val: None = ...
|
||||
lookup_val_isnull: None = ...
|
||||
lookup_choices: Any = ...
|
||||
lookup_title: Any = ...
|
||||
title: Any = ...
|
||||
title: str = ...
|
||||
empty_value_display: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: Union[ForeignObjectRel, ManyToManyField, ForeignKey],
|
||||
field: FieldCacheMixin,
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
@@ -104,7 +112,7 @@ class RelatedFieldListFilter(FieldListFilter):
|
||||
def expected_parameters(self) -> List[str]: ...
|
||||
def field_choices(
|
||||
self,
|
||||
field: Union[ForeignObjectRel, ManyToManyField, ForeignKey],
|
||||
field: FieldCacheMixin,
|
||||
request: WSGIRequest,
|
||||
model_admin: ModelAdmin,
|
||||
) -> Union[List[Tuple[str, str]], List[Tuple[int, str]]]: ...
|
||||
@@ -128,10 +136,14 @@ class BooleanFieldListFilter(FieldListFilter):
|
||||
def choices(self, changelist: Any) -> None: ...
|
||||
|
||||
class ChoicesFieldListFilter(FieldListFilter):
|
||||
lookup_kwarg: Any = ...
|
||||
lookup_kwarg_isnull: Any = ...
|
||||
lookup_val: Any = ...
|
||||
lookup_val_isnull: Any = ...
|
||||
field: django.db.models.fields.IntegerField
|
||||
field_path: str
|
||||
title: str
|
||||
used_parameters: Dict[Any, Any]
|
||||
lookup_kwarg: str = ...
|
||||
lookup_kwarg_isnull: str = ...
|
||||
lookup_val: None = ...
|
||||
lookup_val_isnull: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: Field,
|
||||
@@ -164,12 +176,16 @@ class DateFieldListFilter(FieldListFilter):
|
||||
def choices(self, changelist: Any) -> None: ...
|
||||
|
||||
class AllValuesFieldListFilter(FieldListFilter):
|
||||
lookup_kwarg: Any = ...
|
||||
lookup_kwarg_isnull: Any = ...
|
||||
lookup_val: Any = ...
|
||||
lookup_val_isnull: Any = ...
|
||||
empty_value_display: Any = ...
|
||||
lookup_choices: Any = ...
|
||||
field: django.db.models.fields.CharField
|
||||
field_path: str
|
||||
title: str
|
||||
used_parameters: Dict[Any, Any]
|
||||
lookup_kwarg: str = ...
|
||||
lookup_kwarg_isnull: str = ...
|
||||
lookup_val: None = ...
|
||||
lookup_val_isnull: None = ...
|
||||
empty_value_display: django.utils.safestring.SafeText = ...
|
||||
lookup_choices: django.db.models.query.QuerySet = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: Field,
|
||||
@@ -183,9 +199,14 @@ class AllValuesFieldListFilter(FieldListFilter):
|
||||
def choices(self, changelist: Any) -> None: ...
|
||||
|
||||
class RelatedOnlyFieldListFilter(RelatedFieldListFilter):
|
||||
field: django.db.models.fields.related.ForeignKey
|
||||
field_path: str
|
||||
lookup_kwarg: str
|
||||
lookup_kwarg_isnull: str
|
||||
lookup_val: None
|
||||
lookup_val_isnull: None
|
||||
title: str
|
||||
used_parameters: Dict[Any, Any]
|
||||
def field_choices(
|
||||
self,
|
||||
field: Union[ManyToManyField, ForeignKey],
|
||||
request: WSGIRequest,
|
||||
model_admin: ModelAdmin,
|
||||
self, field: RelatedField, request: WSGIRequest, model_admin: ModelAdmin
|
||||
) -> Union[List[Tuple[str, str]], List[Tuple[int, str]]]: ...
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
class AdminAuthenticationForm:
|
||||
|
||||
class AdminAuthenticationForm(AuthenticationForm):
|
||||
auto_id: str
|
||||
data: Dict[str, str]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[Any, Any]
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
request: None
|
||||
user_cache: None
|
||||
error_messages: Any = ...
|
||||
required_css_class: str = ...
|
||||
def confirm_login_allowed(self, user: User) -> None: ...
|
||||
|
||||
class AdminPasswordChangeForm(PasswordChangeForm):
|
||||
auto_id: str
|
||||
data: Dict[Any, Any]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[Any, Any]
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
user: django.utils.functional.SimpleLazyObject
|
||||
required_css_class: str = ...
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
# Stubs for django.contrib.admin.helpers (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django import forms
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||
from django.db.models.fields import AutoField
|
||||
from django.forms.utils import ErrorDict
|
||||
from django.forms.widgets import Media
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Callable, Dict, Iterator, List, Tuple, Union
|
||||
|
||||
ACTION_CHECKBOX_NAME: str
|
||||
|
||||
class ActionForm(forms.Form):
|
||||
auto_id: None
|
||||
data: Dict[Any, Any]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[Any, Any]
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
action: Any = ...
|
||||
select_across: Any = ...
|
||||
|
||||
@@ -73,13 +77,13 @@ class Fieldline:
|
||||
readonly_fields: Optional[Any] = ...,
|
||||
model_admin: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def __iter__(self) -> Iterator[Union[AdminField, AdminReadonlyField]]: ...
|
||||
def __iter__(self) -> Iterator[Union[AdminReadonlyField, AdminField]]: ...
|
||||
def errors(self) -> SafeText: ...
|
||||
|
||||
class AdminField:
|
||||
field: Any = ...
|
||||
is_first: Any = ...
|
||||
is_checkbox: Any = ...
|
||||
field: django.forms.boundfield.BoundField = ...
|
||||
is_first: bool = ...
|
||||
is_checkbox: bool = ...
|
||||
is_readonly: bool = ...
|
||||
def __init__(self, form: Any, field: Any, is_first: Any) -> None: ...
|
||||
def label_tag(self) -> SafeText: ...
|
||||
@@ -94,7 +98,11 @@ class AdminReadonlyField:
|
||||
is_readonly: bool = ...
|
||||
empty_value_display: Any = ...
|
||||
def __init__(
|
||||
self, form: Any, field: Any, is_first: Any, model_admin: Optional[Any] = ...
|
||||
self,
|
||||
form: Any,
|
||||
field: Any,
|
||||
is_first: Any,
|
||||
model_admin: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def label_tag(self) -> SafeText: ...
|
||||
def contents(self) -> SafeText: ...
|
||||
@@ -130,7 +138,7 @@ class InlineAdminFormSet:
|
||||
@property
|
||||
def forms(self): ...
|
||||
@property
|
||||
def non_form_errors(self): ...
|
||||
def non_form_errors(self) -> Callable: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
|
||||
@@ -164,4 +172,6 @@ class InlineFieldset(Fieldset):
|
||||
def __iter__(self) -> Iterator[Fieldline]: ...
|
||||
|
||||
class AdminErrorList(forms.utils.ErrorList):
|
||||
data: List[Any]
|
||||
error_class: str
|
||||
def __init__(self, form: Any, inline_formsets: Any) -> None: ...
|
||||
|
||||
@@ -1,20 +1,58 @@
|
||||
from typing import Any
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
from uuid import UUID
|
||||
|
||||
class LogEntry:
|
||||
def __str__(self) -> str: ...
|
||||
def get_admin_url(self) -> str: ...
|
||||
def get_change_message(self) -> str: ...
|
||||
def is_addition(self) -> bool: ...
|
||||
def is_change(self) -> bool: ...
|
||||
def is_deletion(self) -> bool: ...
|
||||
from django.db import models
|
||||
from django.db.models.base import Model
|
||||
|
||||
class LogEntryManager:
|
||||
ADDITION: int
|
||||
CHANGE: int
|
||||
DELETION: int
|
||||
ACTION_FLAG_CHOICES: Any
|
||||
|
||||
class LogEntryManager(models.Manager):
|
||||
creation_counter: int
|
||||
model: None
|
||||
name: None
|
||||
use_in_migrations: bool = ...
|
||||
def log_action(
|
||||
self,
|
||||
user_id: int,
|
||||
content_type_id: int,
|
||||
object_id: int,
|
||||
object_id: Union[str, UUID, int],
|
||||
object_repr: str,
|
||||
action_flag: int,
|
||||
change_message: Any = ...,
|
||||
change_message: Union[
|
||||
List[Dict[str, Dict[str, Union[str, List[str]]]]],
|
||||
Dict[str, Dict[str, List[str]]],
|
||||
str,
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Dict[str, List[str]]], Dict[str, Dict[str, str]]
|
||||
]
|
||||
],
|
||||
] = ...,
|
||||
) -> LogEntry: ...
|
||||
|
||||
class LogEntry(models.Model):
|
||||
content_type_id: int
|
||||
id: None
|
||||
user_id: int
|
||||
action_time: datetime.datetime = ...
|
||||
user: Any = ...
|
||||
content_type: Any = ...
|
||||
object_id: str = ...
|
||||
object_repr: str = ...
|
||||
action_flag: int = ...
|
||||
change_message: str = ...
|
||||
objects: Any = ...
|
||||
class Meta:
|
||||
verbose_name: Any = ...
|
||||
verbose_name_plural: Any = ...
|
||||
db_table: str = ...
|
||||
ordering: Any = ...
|
||||
def is_addition(self) -> bool: ...
|
||||
def is_change(self) -> bool: ...
|
||||
def is_deletion(self) -> bool: ...
|
||||
def get_change_message(self) -> str: ...
|
||||
def get_edited_object(self) -> Model: ...
|
||||
def get_admin_url(self) -> Optional[str]: ...
|
||||
|
||||
@@ -1,26 +1,32 @@
|
||||
# Stubs for django.contrib.admin.options (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from django.contrib.admin.models import LogEntry
|
||||
from django.contrib.admin.views.main import ChangeList
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.checks.messages import Error
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.core.paginator import Paginator
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.fields.related import ForeignKey, ManyToManyField
|
||||
from django.db.models.fields import CharField, Field
|
||||
from django.db.models.fields.related import ForeignKey
|
||||
from django.db.models.query import QuerySet
|
||||
from django.forms.fields import Field, TypedChoiceField
|
||||
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
|
||||
from django.forms.models import ModelChoiceField
|
||||
from django.forms.widgets import Media
|
||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
IS_POPUP_VAR: str
|
||||
TO_FIELD_VAR: str
|
||||
HORIZONTAL: Any
|
||||
VERTICAL: Any
|
||||
|
||||
def get_content_type_for_model(obj: Any): ...
|
||||
def get_content_type_for_model(
|
||||
obj: Union[Type[Model], Model]
|
||||
) -> ContentType: ...
|
||||
def get_ul_class(radio_style: Any): ...
|
||||
|
||||
class IncorrectLookupParameters(Exception): ...
|
||||
@@ -49,52 +55,88 @@ class BaseModelAdmin:
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
def __init__(self) -> None: ...
|
||||
def formfield_for_dbfield(
|
||||
self, db_field: Field, request: object, **kwargs: Any
|
||||
self, db_field: Field, request: WSGIRequest, **kwargs: Any
|
||||
) -> Optional[Field]: ...
|
||||
def formfield_for_choice_field(
|
||||
self, db_field: Field, request: object, **kwargs: Any
|
||||
self, db_field: CharField, request: WSGIRequest, **kwargs: Any
|
||||
) -> TypedChoiceField: ...
|
||||
def get_field_queryset(
|
||||
self, db: None, db_field: Union[ManyToManyField, ForeignKey], request: object
|
||||
) -> Optional[QuerySet]: ...
|
||||
self, db: None, db_field: ForeignKey, request: WSGIRequest
|
||||
) -> None: ...
|
||||
def formfield_for_foreignkey(
|
||||
self, db_field: ForeignKey, request: object, **kwargs: Any
|
||||
self, db_field: ForeignKey, request: WSGIRequest, **kwargs: Any
|
||||
) -> Optional[ModelChoiceField]: ...
|
||||
def formfield_for_manytomany(
|
||||
self, db_field: ManyToManyField, request: WSGIRequest, **kwargs: Any
|
||||
) -> ModelMultipleChoiceField: ...
|
||||
def get_autocomplete_fields(self, request: object) -> Tuple: ...
|
||||
def get_view_on_site_url(self, obj: Optional[Model] = ...) -> Optional[str]: ...
|
||||
self, db_field: Any, request: Any, **kwargs: Any
|
||||
): ...
|
||||
def get_autocomplete_fields(self, request: WSGIRequest) -> Tuple: ...
|
||||
def get_view_on_site_url(self, obj: Optional[Model] = ...) -> None: ...
|
||||
def get_empty_value_display(self) -> SafeText: ...
|
||||
def get_exclude(self, request: object, obj: Optional[Model] = ...) -> None: ...
|
||||
def get_exclude(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> None: ...
|
||||
def get_fields(
|
||||
self, request: object, obj: Optional[Model] = ...
|
||||
) -> Union[List[str], List[Union[str, Callable]]]: ...
|
||||
def get_fieldsets(self, request: WSGIRequest, obj: Optional[Model] = ...) -> Any: ...
|
||||
def get_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> List[str]: ...
|
||||
def get_fieldsets(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> Union[
|
||||
Tuple[Tuple[None, Dict[str, Tuple[Tuple[str, str]]]]],
|
||||
List[Tuple[None, Dict[str, List[str]]]],
|
||||
]: ...
|
||||
def get_ordering(self, request: WSGIRequest) -> Tuple: ...
|
||||
def get_readonly_fields(
|
||||
self, request: object, obj: Optional[Model] = ...
|
||||
) -> Union[List[str], Tuple]: ...
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> Tuple: ...
|
||||
def get_prepopulated_fields(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> Dict[str, Tuple[str]]: ...
|
||||
def get_queryset(self, request: object) -> QuerySet: ...
|
||||
def get_sortable_by(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
||||
) -> Dict[Any, Any]: ...
|
||||
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
||||
def get_sortable_by(self, request: WSGIRequest) -> Tuple[str]: ...
|
||||
def lookup_allowed(self, lookup: Any, value: Any): ...
|
||||
def to_field_allowed(self, request: Any, to_field: Any): ...
|
||||
def to_field_allowed(self, request: WSGIRequest, to_field: str) -> bool: ...
|
||||
def has_add_permission(self, request: WSGIRequest) -> bool: ...
|
||||
def has_change_permission(
|
||||
self, request: object, obj: Optional[Model] = ...
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> bool: ...
|
||||
def has_delete_permission(
|
||||
self, request: object, obj: Optional[Model] = ...
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> bool: ...
|
||||
def has_view_permission(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> bool: ...
|
||||
def has_module_permission(self, request: object) -> bool: ...
|
||||
def has_module_permission(self, request: Any): ...
|
||||
|
||||
class ModelAdmin(BaseModelAdmin):
|
||||
formfield_overrides: Dict[
|
||||
Type[
|
||||
Union[
|
||||
django.db.models.fields.DateField,
|
||||
django.db.models.fields.TimeField,
|
||||
django.db.models.fields.TextField,
|
||||
django.db.models.fields.IntegerField,
|
||||
django.db.models.fields.CharField,
|
||||
django.db.models.fields.files.FileField,
|
||||
]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
Union[
|
||||
django.forms.fields.SplitDateTimeField,
|
||||
django.contrib.admin.widgets.AdminSplitDateTime,
|
||||
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,
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
list_display: Any = ...
|
||||
list_display_links: Any = ...
|
||||
list_filter: Any = ...
|
||||
@@ -123,69 +165,101 @@ class ModelAdmin(BaseModelAdmin):
|
||||
actions_on_bottom: bool = ...
|
||||
actions_selection_counter: bool = ...
|
||||
checks_class: Any = ...
|
||||
model: Any = ...
|
||||
opts: Any = ...
|
||||
admin_site: Any = ...
|
||||
model: Type[django.db.models.base.Model] = ...
|
||||
opts: django.db.models.options.Options = ...
|
||||
admin_site: django.contrib.admin.sites.AdminSite = ...
|
||||
def __init__(self, model: Any, admin_site: Any) -> None: ...
|
||||
def __str__(self): ...
|
||||
def get_inline_instances(self, request: Any, obj: Optional[Any] = ...): ...
|
||||
def get_inline_instances(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> List[InlineModelAdmin]: ...
|
||||
def get_urls(self): ...
|
||||
@property
|
||||
def urls(self): ...
|
||||
@property
|
||||
def media(self): ...
|
||||
def media(self) -> Media: ...
|
||||
def get_model_perms(self, request: Any): ...
|
||||
def _get_form_for_get_fields(self, request: Any, obj: Any): ...
|
||||
def get_form(
|
||||
self, request: Any, obj: Optional[Any] = ..., change: bool = ..., **kwargs: Any
|
||||
): ...
|
||||
def get_changelist(self, request: Any, **kwargs: Any): ...
|
||||
def get_changelist_instance(self, request: Any): ...
|
||||
def get_object(self, request: Any, object_id: Any, from_field: Optional[Any] = ...): ...
|
||||
def get_changelist_form(self, request: Any, **kwargs: Any): ...
|
||||
def get_changelist_formset(self, request: Any, **kwargs: Any): ...
|
||||
def get_formsets_with_inlines(self, request: Any, obj: Optional[Any] = ...) -> None: ...
|
||||
def get_paginator(
|
||||
self,
|
||||
request: Any,
|
||||
queryset: Any,
|
||||
per_page: Any,
|
||||
obj: Optional[Any] = ...,
|
||||
change: bool = ...,
|
||||
**kwargs: Any
|
||||
): ...
|
||||
def get_changelist(
|
||||
self, request: WSGIRequest, **kwargs: Any
|
||||
) -> Type[ChangeList]: ...
|
||||
def get_changelist_instance(self, request: WSGIRequest) -> ChangeList: ...
|
||||
def get_object(
|
||||
self, request: WSGIRequest, object_id: str, from_field: None = ...
|
||||
) -> Optional[Model]: ...
|
||||
def get_changelist_form(self, request: Any, **kwargs: Any): ...
|
||||
def get_changelist_formset(self, request: Any, **kwargs: Any): ...
|
||||
def get_formsets_with_inlines(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> None: ...
|
||||
def get_paginator(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
queryset: QuerySet,
|
||||
per_page: int,
|
||||
orphans: int = ...,
|
||||
allow_empty_first_page: bool = ...,
|
||||
): ...
|
||||
def log_addition(self, request: Any, object: Any, message: Any): ...
|
||||
def log_change(self, request: Any, object: Any, message: Any): ...
|
||||
def log_deletion(self, request: Any, object: Any, object_repr: Any): ...
|
||||
def action_checkbox(self, obj: Any): ...
|
||||
def _get_base_actions(self): ...
|
||||
def _filter_actions_by_permissions(self, request: Any, actions: Any): ...
|
||||
def get_actions(self, request: Any): ...
|
||||
def get_action_choices(self, request: Any, default_choices: Any = ...): ...
|
||||
) -> Paginator: ...
|
||||
def log_addition(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
object: Model,
|
||||
message: List[Dict[str, Dict[str, str]]],
|
||||
) -> LogEntry: ...
|
||||
def log_change(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
object: Model,
|
||||
message: List[Dict[str, Dict[str, Union[str, List[str]]]]],
|
||||
) -> LogEntry: ...
|
||||
def log_deletion(
|
||||
self, request: WSGIRequest, object: Model, object_repr: str
|
||||
) -> LogEntry: ...
|
||||
def action_checkbox(self, obj: Model) -> SafeText: ...
|
||||
def get_actions(self, request: WSGIRequest) -> OrderedDict: ...
|
||||
def get_action_choices(
|
||||
self, request: WSGIRequest, default_choices: List[Tuple[str, str]] = ...
|
||||
) -> List[Tuple[str, str]]: ...
|
||||
def get_action(self, action: Any): ...
|
||||
def get_list_display(self, request: Any): ...
|
||||
def get_list_display_links(self, request: Any, list_display: Any): ...
|
||||
def get_list_filter(self, request: Any): ...
|
||||
def get_list_select_related(self, request: Any): ...
|
||||
def get_search_fields(self, request: Any): ...
|
||||
def get_search_results(self, request: Any, queryset: Any, search_term: Any): ...
|
||||
def get_preserved_filters(self, request: Any): ...
|
||||
def get_list_display(self, request: WSGIRequest) -> Tuple[str]: ...
|
||||
def get_list_display_links(
|
||||
self, request: WSGIRequest, list_display: Tuple[str]
|
||||
) -> List[str]: ...
|
||||
def get_list_filter(self, request: WSGIRequest) -> Tuple: ...
|
||||
def get_list_select_related(self, request: WSGIRequest) -> bool: ...
|
||||
def get_search_fields(self, request: WSGIRequest) -> Tuple: ...
|
||||
def get_search_results(
|
||||
self, request: WSGIRequest, queryset: QuerySet, search_term: str
|
||||
) -> Tuple[QuerySet, bool]: ...
|
||||
def get_preserved_filters(self, request: WSGIRequest) -> str: ...
|
||||
def construct_change_message(
|
||||
self, request: Any, form: Any, formsets: Any, add: bool = ...
|
||||
): ...
|
||||
def message_user(
|
||||
self,
|
||||
request: Any,
|
||||
message: Any,
|
||||
level: Any = ...,
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
level: int = ...,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: bool = ...,
|
||||
) -> None: ...
|
||||
def save_form(self, request: Any, form: Any, change: Any): ...
|
||||
def save_model(self, request: Any, obj: Any, form: Any, change: Any) -> None: ...
|
||||
def delete_model(self, request: Any, obj: Any) -> None: ...
|
||||
def save_model(
|
||||
self, request: Any, obj: Any, form: Any, change: Any
|
||||
) -> None: ...
|
||||
def delete_model(self, request: WSGIRequest, obj: Model) -> None: ...
|
||||
def delete_queryset(self, request: Any, queryset: Any) -> None: ...
|
||||
def save_formset(self, request: Any, form: Any, formset: Any, change: Any) -> None: ...
|
||||
def save_related(self, request: Any, form: Any, formsets: Any, change: Any) -> None: ...
|
||||
def save_formset(
|
||||
self, request: Any, form: Any, formset: Any, change: Any
|
||||
) -> None: ...
|
||||
def save_related(
|
||||
self, request: Any, form: Any, formsets: Any, change: Any
|
||||
) -> None: ...
|
||||
def render_change_form(
|
||||
self,
|
||||
request: Any,
|
||||
@@ -196,52 +270,69 @@ class ModelAdmin(BaseModelAdmin):
|
||||
obj: Optional[Any] = ...,
|
||||
): ...
|
||||
def response_add(
|
||||
self, request: Any, obj: Any, post_url_continue: Optional[Any] = ...
|
||||
): ...
|
||||
def response_change(self, request: Any, obj: Any): ...
|
||||
def response_post_save_add(self, request: Any, obj: Any): ...
|
||||
def response_post_save_change(self, request: Any, obj: Any): ...
|
||||
def response_action(self, request: Any, queryset: Any): ...
|
||||
def response_delete(self, request: Any, obj_display: Any, obj_id: Any): ...
|
||||
self, request: WSGIRequest, obj: Model, post_url_continue: None = ...
|
||||
) -> HttpResponse: ...
|
||||
def response_change(
|
||||
self, request: WSGIRequest, obj: Model
|
||||
) -> HttpResponse: ...
|
||||
def response_post_save_add(
|
||||
self, request: WSGIRequest, obj: Model
|
||||
) -> HttpResponseRedirect: ...
|
||||
def response_post_save_change(
|
||||
self, request: WSGIRequest, obj: User
|
||||
) -> HttpResponseRedirect: ...
|
||||
def response_action(
|
||||
self, request: WSGIRequest, queryset: QuerySet
|
||||
) -> Optional[TemplateResponse]: ...
|
||||
def response_delete(
|
||||
self, request: WSGIRequest, obj_display: str, obj_id: int
|
||||
) -> HttpResponse: ...
|
||||
def render_delete_form(self, request: Any, context: Any): ...
|
||||
def get_inline_formsets(
|
||||
self, request: Any, formsets: Any, inline_instances: Any, obj: Optional[Any] = ...
|
||||
): ...
|
||||
def get_changeform_initial_data(self, request: Any): ...
|
||||
def _get_obj_does_not_exist_redirect(self, request: Any, opts: Any, object_id: Any): ...
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
formsets: List[Any],
|
||||
inline_instances: List[Any],
|
||||
obj: Optional[Model] = ...,
|
||||
) -> List[Any]: ...
|
||||
def get_changeform_initial_data(
|
||||
self, request: WSGIRequest
|
||||
) -> Dict[Any, Any]: ...
|
||||
def changeform_view(
|
||||
self,
|
||||
request: Any,
|
||||
object_id: Optional[Any] = ...,
|
||||
request: WSGIRequest,
|
||||
object_id: Optional[str] = ...,
|
||||
form_url: str = ...,
|
||||
extra_context: Optional[Any] = ...,
|
||||
): ...
|
||||
def _changeform_view(
|
||||
self, request: Any, object_id: Any, form_url: Any, extra_context: Any
|
||||
): ...
|
||||
extra_context: None = ...,
|
||||
) -> Any: ...
|
||||
def autocomplete_view(self, request: Any): ...
|
||||
def add_view(
|
||||
self, request: Any, form_url: str = ..., extra_context: Optional[Any] = ...
|
||||
): ...
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
form_url: str = ...,
|
||||
extra_context: None = ...,
|
||||
) -> HttpResponse: ...
|
||||
def change_view(
|
||||
self,
|
||||
request: Any,
|
||||
object_id: Any,
|
||||
request: WSGIRequest,
|
||||
object_id: str,
|
||||
form_url: str = ...,
|
||||
extra_context: Optional[Any] = ...,
|
||||
): ...
|
||||
def _get_edited_object_pks(self, request: Any, prefix: Any): ...
|
||||
def _get_list_editable_queryset(self, request: Any, prefix: Any): ...
|
||||
def changelist_view(self, request: Any, extra_context: Optional[Any] = ...): ...
|
||||
def get_deleted_objects(self, objs: Any, request: Any): ...
|
||||
extra_context: None = ...,
|
||||
) -> HttpResponse: ...
|
||||
def changelist_view(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
extra_context: Optional[Dict[str, str]] = ...,
|
||||
) -> HttpResponse: ...
|
||||
def get_deleted_objects(
|
||||
self, objs: QuerySet, request: WSGIRequest
|
||||
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
||||
def delete_view(
|
||||
self, request: Any, object_id: Any, extra_context: Optional[Any] = ...
|
||||
): ...
|
||||
def _delete_view(self, request: Any, object_id: Any, extra_context: Any): ...
|
||||
self, request: WSGIRequest, object_id: str, extra_context: None = ...
|
||||
) -> Any: ...
|
||||
def history_view(
|
||||
self, request: Any, object_id: Any, extra_context: Optional[Any] = ...
|
||||
): ...
|
||||
def _create_formsets(self, request: Any, obj: Any, change: Any): ...
|
||||
self, request: WSGIRequest, object_id: str, extra_context: None = ...
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
class InlineModelAdmin(BaseModelAdmin):
|
||||
model: Any = ...
|
||||
@@ -263,18 +354,33 @@ class InlineModelAdmin(BaseModelAdmin):
|
||||
has_registered_model: Any = ...
|
||||
def __init__(self, parent_model: Any, admin_site: Any) -> None: ...
|
||||
@property
|
||||
def media(self): ...
|
||||
def get_extra(self, request: Any, obj: Optional[Any] = ..., **kwargs: Any): ...
|
||||
def get_min_num(self, request: Any, obj: Optional[Any] = ..., **kwargs: Any): ...
|
||||
def get_max_num(self, request: Any, obj: Optional[Any] = ..., **kwargs: Any): ...
|
||||
def media(self) -> Media: ...
|
||||
def get_extra(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any
|
||||
) -> int: ...
|
||||
def get_min_num(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def get_max_num(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
fields: Any = ...
|
||||
def get_formset(self, request: Any, obj: Optional[Any] = ..., **kwargs: Any): ...
|
||||
def _get_form_for_get_fields(self, request: Any, obj: Optional[Any] = ...): ...
|
||||
def get_queryset(self, request: Any): ...
|
||||
def has_add_permission(self, request: Any, obj: Any): ...
|
||||
def has_change_permission(self, request: Any, obj: Optional[Any] = ...): ...
|
||||
def has_delete_permission(self, request: Any, obj: Optional[Any] = ...): ...
|
||||
def has_view_permission(self, request: Any, obj: Optional[Any] = ...): ...
|
||||
def get_formset(
|
||||
self, request: Any, obj: Optional[Any] = ..., **kwargs: Any
|
||||
): ...
|
||||
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
||||
def has_add_permission(
|
||||
self, request: WSGIRequest, obj: Optional[Model]
|
||||
) -> bool: ...
|
||||
def has_change_permission(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> bool: ...
|
||||
def has_delete_permission(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> bool: ...
|
||||
def has_view_permission(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> bool: ...
|
||||
|
||||
class StackedInline(InlineModelAdmin):
|
||||
template: str = ...
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
# Stubs for django.contrib.admin.sites (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.utils.functional import LazyObject
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.contrib.admin.options import ModelAdmin
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||
from django.http.response import HttpResponse
|
||||
from django.template.response import TemplateResponse
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
from typing import Any, Callable, Dict, List, Tuple, Type, Union
|
||||
from django.utils.functional import LazyObject
|
||||
|
||||
all_sites: Any
|
||||
|
||||
@@ -22,7 +18,6 @@ class AdminSite:
|
||||
site_header: Any = ...
|
||||
index_title: Any = ...
|
||||
site_url: str = ...
|
||||
_empty_value_display: str = ...
|
||||
login_form: Any = ...
|
||||
index_template: Any = ...
|
||||
app_index_template: Any = ...
|
||||
@@ -30,19 +25,21 @@ class AdminSite:
|
||||
logout_template: Any = ...
|
||||
password_change_template: Any = ...
|
||||
password_change_done_template: Any = ...
|
||||
_registry: Any = ...
|
||||
name: Any = ...
|
||||
_actions: Any = ...
|
||||
_global_actions: Any = ...
|
||||
name: str = ...
|
||||
def __init__(self, name: str = ...) -> None: ...
|
||||
def check(self, app_configs: None) -> List[Any]: ...
|
||||
def check(self, app_configs: None) -> List[str]: ...
|
||||
def register(
|
||||
self, model_or_iterable: Any, admin_class: Any = ..., **options: Any
|
||||
self,
|
||||
model_or_iterable: Union[
|
||||
Tuple[Type[Model]], Type[Model], List[Type[Model]]
|
||||
],
|
||||
admin_class: Optional[Type[ModelAdmin]] = ...,
|
||||
**options: Any
|
||||
) -> None: ...
|
||||
def unregister(self, model_or_iterable: Type[Model]) -> None: ...
|
||||
def is_registered(self, model: Type[Model]) -> bool: ...
|
||||
def add_action(self, action: Callable, name: None = ...) -> None: ...
|
||||
def disable_action(self, name: Any) -> None: ...
|
||||
def disable_action(self, name: str) -> None: ...
|
||||
def get_action(self, name: str) -> Callable: ...
|
||||
@property
|
||||
def actions(self): ...
|
||||
@@ -54,12 +51,7 @@ class AdminSite:
|
||||
def admin_view(self, view: Callable, cacheable: bool = ...) -> Callable: ...
|
||||
def get_urls(self) -> List[Union[URLPattern, URLResolver]]: ...
|
||||
@property
|
||||
def urls(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[List[URLPattern], str, str],
|
||||
Tuple[List[Union[URLPattern, URLResolver]], str, str],
|
||||
]: ...
|
||||
def urls(self) -> Tuple[List[Union[URLPattern, URLResolver]], str, str]: ...
|
||||
def each_context(self, request: Any): ...
|
||||
def password_change(
|
||||
self, request: WSGIRequest, extra_context: Dict[str, str] = ...
|
||||
@@ -68,27 +60,26 @@ class AdminSite:
|
||||
self, request: WSGIRequest, extra_context: None = ...
|
||||
) -> TemplateResponse: ...
|
||||
def i18n_javascript(
|
||||
self, request: WSGIRequest, extra_context: None = ...
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
extra_context: Optional[Dict[Any, Any]] = ...,
|
||||
) -> HttpResponse: ...
|
||||
def logout(
|
||||
self, request: WSGIRequest, extra_context: None = ...
|
||||
) -> TemplateResponse: ...
|
||||
def login(
|
||||
self, request: WSGIRequest, extra_context: None = ...
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
def _build_app_dict(
|
||||
self, request: WSGIRequest, label: None = ...
|
||||
) -> Dict[Any, Any]: ...
|
||||
) -> HttpResponse: ...
|
||||
def get_app_list(self, request: WSGIRequest) -> List[Any]: ...
|
||||
def index(
|
||||
self, request: WSGIRequest, extra_context: None = ...
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
extra_context: Optional[Dict[str, str]] = ...,
|
||||
) -> TemplateResponse: ...
|
||||
def app_index(
|
||||
self, request: WSGIRequest, app_label: str, extra_context: None = ...
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
class DefaultAdminSite(LazyObject):
|
||||
_wrapped: Any = ...
|
||||
def _setup(self) -> None: ...
|
||||
class DefaultAdminSite(LazyObject): ...
|
||||
|
||||
site: Any
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
# Stubs for django.contrib.admin.templatetags.admin_list (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .base import InclusionAdminNode
|
||||
from typing import Any
|
||||
from typing import Any, Dict, Iterator, List, Optional, Union
|
||||
|
||||
from django.contrib.admin.filters import FieldListFilter
|
||||
from django.contrib.admin.templatetags.base import InclusionAdminNode
|
||||
@@ -13,7 +8,8 @@ from django.forms.boundfield import BoundField
|
||||
from django.template.base import Parser, Token
|
||||
from django.template.context import RequestContext
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Callable, Dict, Iterator, Optional, Union
|
||||
|
||||
from .base import InclusionAdminNode
|
||||
|
||||
register: Any
|
||||
DOT: str
|
||||
@@ -21,24 +17,35 @@ DOT: str
|
||||
def paginator_number(cl: ChangeList, i: int) -> SafeText: ...
|
||||
def pagination(cl: ChangeList) -> Dict[str, Any]: ...
|
||||
def pagination_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def result_headers(cl: ChangeList) -> Iterator[Dict[str, Optional[Union[int, str]]]]: ...
|
||||
def _boolean_icon(field_val: Optional[bool]) -> SafeText: ...
|
||||
def _coerce_field_name(field_name: Union[str, Callable], field_index: int) -> str: ...
|
||||
def items_for_result(cl: ChangeList, result: Model, form: None) -> Iterator[SafeText]: ...
|
||||
def result_headers(
|
||||
cl: ChangeList
|
||||
) -> Iterator[Dict[str, Optional[Union[int, str]]]]: ...
|
||||
def items_for_result(
|
||||
cl: ChangeList, result: Model, form: None
|
||||
) -> Iterator[SafeText]: ...
|
||||
|
||||
class ResultList(list):
|
||||
form: Any = ...
|
||||
form: None = ...
|
||||
def __init__(self, form: None, *items: Any) -> None: ...
|
||||
|
||||
def results(cl: ChangeList) -> Iterator[ResultList]: ...
|
||||
def result_hidden_fields(cl: ChangeList) -> Iterator[BoundField]: ...
|
||||
def result_list(cl: ChangeList) -> Dict[str, Any]: ...
|
||||
def result_list_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def date_hierarchy(cl: ChangeList) -> Any: ...
|
||||
def date_hierarchy(
|
||||
cl: ChangeList
|
||||
) -> Optional[
|
||||
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 search_form(cl: ChangeList) -> Dict[str, Union[ChangeList, bool, str]]: ...
|
||||
def search_form_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def admin_list_filter(cl: ChangeList, spec: FieldListFilter) -> SafeText: ...
|
||||
def admin_actions(context: RequestContext) -> RequestContext: ...
|
||||
def admin_actions_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def change_list_object_tools_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def change_list_object_tools_tag(
|
||||
parser: Parser, token: Token
|
||||
) -> InclusionAdminNode: ...
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
# Stubs for django.contrib.admin.templatetags.admin_modify (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .base import InclusionAdminNode
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.admin.helpers import InlineAdminForm
|
||||
from django.contrib.admin.templatetags.base import InclusionAdminNode
|
||||
from django.template.base import Parser, Token
|
||||
from django.template.context import Context, RequestContext
|
||||
|
||||
from .base import InclusionAdminNode
|
||||
|
||||
register: Any
|
||||
|
||||
def prepopulated_fields_js(context: RequestContext) -> RequestContext: ...
|
||||
def prepopulated_fields_js_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def prepopulated_fields_js_tag(
|
||||
parser: Parser, token: Token
|
||||
) -> InclusionAdminNode: ...
|
||||
def submit_row(context: RequestContext) -> Context: ...
|
||||
def submit_row_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def change_form_object_tools_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def change_form_object_tools_tag(
|
||||
parser: Parser, token: Token
|
||||
) -> InclusionAdminNode: ...
|
||||
def cell_count(inline_admin_form: InlineAdminForm) -> int: ...
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
# Stubs for django.contrib.admin.templatetags.admin_static (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
|
||||
register: Any
|
||||
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
# Stubs for django.contrib.admin.templatetags.admin_urls (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Dict, Optional, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.db.models.options import Options
|
||||
from django.template.context import RequestContext
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Dict, Optional, Union
|
||||
from uuid import UUID
|
||||
|
||||
register: Any
|
||||
|
||||
def admin_urlname(value: Options, arg: SafeText) -> str: ...
|
||||
def admin_urlquote(value: Union[str, int, UUID]) -> Union[str, int, UUID]: ...
|
||||
def admin_urlquote(value: Union[str, UUID, int]) -> Union[str, UUID, int]: ...
|
||||
def add_preserved_filters(
|
||||
context: Union[Dict[str, Union[str, Options]], RequestContext],
|
||||
url: str,
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
# Stubs for django.contrib.admin.templatetags.base (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.template.library import InclusionNode
|
||||
from typing import Any
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from django.template.base import Parser, Token
|
||||
from django.template.context import Context
|
||||
from django.template.library import InclusionNode
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Callable
|
||||
|
||||
|
||||
class InclusionAdminNode(InclusionNode):
|
||||
template_name: Any = ...
|
||||
args: List[Any]
|
||||
func: Callable
|
||||
kwargs: Dict[Any, Any]
|
||||
takes_context: bool
|
||||
template_name: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
parser: Parser,
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django import template
|
||||
from django.template.base import Parser, Token
|
||||
from django.template.context import Context
|
||||
|
||||
def get_admin_log(parser: Parser, token: Token) -> AdminLogNode: ...
|
||||
register: Any
|
||||
|
||||
class AdminLogNode:
|
||||
def __init__(self, limit: str, varname: str, user: str) -> None: ...
|
||||
class AdminLogNode(template.Node):
|
||||
limit: str
|
||||
user: str
|
||||
varname: str
|
||||
def __init__(
|
||||
self, limit: str, varname: str, user: Optional[str]
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
def get_admin_log(parser: Parser, token: Token) -> AdminLogNode: ...
|
||||
|
||||
@@ -1,26 +1,19 @@
|
||||
# Stubs for django.contrib.admin.utils (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from datetime import date, datetime
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from django.db.models.deletion import Collector
|
||||
from typing import Any, Optional
|
||||
|
||||
from datetime import datetime
|
||||
from django.contrib.admin.options import ModelAdmin, TabularInline
|
||||
from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.admin.options import BaseModelAdmin
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.deletion import Collector
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.fields.reverse_related import (
|
||||
ForeignObjectRel,
|
||||
ManyToManyRel,
|
||||
ManyToOneRel,
|
||||
OneToOneRel,
|
||||
)
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.reverse_related import ManyToOneRel, OneToOneRel
|
||||
from django.db.models.options import Options
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
|
||||
class FieldIsAForeignKeyColumnName(Exception): ...
|
||||
|
||||
@@ -28,15 +21,37 @@ def lookup_needs_distinct(opts: Options, lookup_path: str) -> bool: ...
|
||||
def prepare_lookup_value(
|
||||
key: str, value: Union[str, datetime]
|
||||
) -> Union[bool, datetime, str]: ...
|
||||
def quote(s: Union[str, UUID, int]) -> Union[str, UUID, int]: ...
|
||||
def quote(s: Union[str, int]) -> Union[str, int]: ...
|
||||
def unquote(s: str) -> str: ...
|
||||
def flatten(
|
||||
fields: Union[Tuple, List[Union[str, Callable]], List[str]]
|
||||
) -> Union[List[Union[str, Callable]], List[str]]: ...
|
||||
def flatten_fieldsets(fieldsets: Any) -> Union[List[str], List[Union[str, Callable]]]: ...
|
||||
def get_deleted_objects(objs: Any, request: Any, admin_site: Any): ...
|
||||
fields: Union[
|
||||
List[Union[str, Callable]], Tuple[Tuple[str, str]], Tuple[str, str]
|
||||
]
|
||||
) -> List[Union[str, Callable]]: ...
|
||||
def flatten_fieldsets(
|
||||
fieldsets: Union[
|
||||
List[Tuple[None, Dict[str, List[Union[str, Callable]]]]],
|
||||
Tuple[
|
||||
Union[
|
||||
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]]: ...
|
||||
def get_deleted_objects(
|
||||
objs: QuerySet, request: WSGIRequest, admin_site: AdminSite
|
||||
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
||||
|
||||
class NestedObjects(Collector):
|
||||
data: collections.OrderedDict
|
||||
dependencies: Dict[Any, Any]
|
||||
fast_deletes: List[Any]
|
||||
field_updates: Dict[Any, Any]
|
||||
using: str
|
||||
edges: Any = ...
|
||||
protected: Any = ...
|
||||
model_objs: Any = ...
|
||||
@@ -44,47 +59,66 @@ class NestedObjects(Collector):
|
||||
def add_edge(self, source: Optional[Model], target: Model) -> None: ...
|
||||
def collect(
|
||||
self,
|
||||
objs: Union[List[Model], QuerySet],
|
||||
objs: Union[QuerySet, List[Model]],
|
||||
source: Optional[Type[Model]] = ...,
|
||||
source_attr: Optional[str] = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def related_objects(
|
||||
self, related: ManyToOneRel, objs: Union[List[User], List[Model]]
|
||||
self, related: ManyToOneRel, objs: List[Model]
|
||||
) -> QuerySet: ...
|
||||
def _nested(self, obj: Model, seen: Set[Model], format_callback: Callable) -> Any: ...
|
||||
def nested(self, format_callback: Callable = ...) -> Any: ...
|
||||
def nested(
|
||||
self, format_callback: Callable = ...
|
||||
) -> Union[
|
||||
List[Union[List[str], str]], List[Union[SafeText, List[SafeText]]]
|
||||
]: ...
|
||||
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ...
|
||||
|
||||
def model_format_dict(obj: Any): ...
|
||||
def model_ngettext(obj: QuerySet, n: None = ...) -> str: ...
|
||||
def lookup_field(
|
||||
name: Union[str, Callable],
|
||||
obj: Model,
|
||||
model_admin: Union[ModelAdmin, TabularInline] = ...,
|
||||
) -> Any: ...
|
||||
def _get_non_gfk_field(
|
||||
opts: Options, name: Union[str, Callable]
|
||||
) -> Union[Field, reverse_related.ManyToManyRel, reverse_related.OneToOneRel]: ...
|
||||
name: Union[str, Callable], obj: Model, model_admin: BaseModelAdmin = ...
|
||||
) -> Union[
|
||||
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(
|
||||
name: Union[str, Callable],
|
||||
model: Type[Model],
|
||||
model_admin: Optional[Union[ModelAdmin, TabularInline]] = ...,
|
||||
model_admin: BaseModelAdmin = ...,
|
||||
return_attr: bool = ...,
|
||||
) -> Any: ...
|
||||
) -> Union[
|
||||
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 display_for_field(
|
||||
value: Any, field: Union[Field, reverse_related.OneToOneRel], empty_value_display: str
|
||||
value: Optional[Union[int, str, date, Model]],
|
||||
field: Union[Field, reverse_related.OneToOneRel],
|
||||
empty_value_display: SafeText,
|
||||
) -> str: ...
|
||||
def display_for_value(
|
||||
value: Optional[Union[Callable, Model, int, str]],
|
||||
empty_value_display: SafeText,
|
||||
boolean: bool = ...,
|
||||
) -> str: ...
|
||||
def display_for_value(value: Any, empty_value_display: str, boolean: bool = ...) -> str: ...
|
||||
|
||||
class NotRelationField(Exception): ...
|
||||
|
||||
def get_model_from_relation(field: Union[ForeignObjectRel, Field]) -> Type[Model]: ...
|
||||
def get_model_from_relation(
|
||||
field: Union[Field, reverse_related.ManyToOneRel]
|
||||
) -> Type[Model]: ...
|
||||
def reverse_field_path(
|
||||
model: Type[Model], path: str
|
||||
) -> Union[Tuple[Type[Model], str], Tuple[Type[User], str]]: ...
|
||||
def get_fields_from_path(model: Type[Model], path: str) -> Any: ...
|
||||
def construct_change_message(
|
||||
form: AdminPasswordChangeForm, formsets: None, add: bool
|
||||
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||
) -> Tuple[Type[Model], str]: ...
|
||||
def get_fields_from_path(
|
||||
model: Type[Model], path: str
|
||||
) -> List[Union[FieldCacheMixin, Field]]: ...
|
||||
def construct_change_message(form: Any, formsets: Any, add: Any): ...
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
# Stubs for django.contrib.admin.views.autocomplete (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.views.generic.list import BaseListView
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.core.paginator import Paginator
|
||||
from django.db.models.query import QuerySet
|
||||
from django.http.response import JsonResponse
|
||||
from django.views.generic.list import BaseListView
|
||||
|
||||
|
||||
class AutocompleteJsonView(BaseListView):
|
||||
paginate_by: int = ...
|
||||
model_admin: Any = ...
|
||||
model_admin: django.contrib.admin.options.ModelAdmin = ...
|
||||
term: Any = ...
|
||||
paginator_class: Any = ...
|
||||
object_list: Any = ...
|
||||
def get(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> JsonResponse: ...
|
||||
def get(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> JsonResponse: ...
|
||||
def get_paginator(self, *args: Any, **kwargs: Any) -> Paginator: ...
|
||||
def get_queryset(self) -> QuerySet: ...
|
||||
def has_perm(self, request: WSGIRequest, obj: None = ...) -> bool: ...
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
# Stubs for django.contrib.admin.views.decorators (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Callable
|
||||
|
||||
def staff_member_required(
|
||||
view_func: None = ..., redirect_field_name: str = ..., login_url: str = ...
|
||||
view_func: Optional[Callable] = ...,
|
||||
redirect_field_name: str = ...,
|
||||
login_url: str = ...,
|
||||
) -> Callable: ...
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
# Stubs for django.contrib.admin.views.main (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from collections import OrderedDict
|
||||
from django.contrib.admin.filters import SimpleListFilter
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.contrib.admin.filters import ListFilter, SimpleListFilter
|
||||
from django.contrib.admin.options import ModelAdmin
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import CombinedExpression
|
||||
from django.db.models.expressions import (Combinable, CombinedExpression,
|
||||
OrderBy)
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
ALL_VAR: str
|
||||
ORDER_VAR: str
|
||||
@@ -22,28 +18,28 @@ ERROR_FLAG: str
|
||||
IGNORED_PARAMS: Any
|
||||
|
||||
class ChangeList:
|
||||
model: Any = ...
|
||||
opts: Any = ...
|
||||
lookup_opts: Any = ...
|
||||
root_queryset: Any = ...
|
||||
list_display: Any = ...
|
||||
list_display_links: Any = ...
|
||||
list_filter: Any = ...
|
||||
date_hierarchy: Any = ...
|
||||
search_fields: Any = ...
|
||||
list_select_related: Any = ...
|
||||
list_per_page: Any = ...
|
||||
list_max_show_all: Any = ...
|
||||
model_admin: Any = ...
|
||||
preserved_filters: Any = ...
|
||||
sortable_by: Any = ...
|
||||
page_num: Any = ...
|
||||
show_all: Any = ...
|
||||
is_popup: Any = ...
|
||||
to_field: Any = ...
|
||||
params: Any = ...
|
||||
list_editable: Any = ...
|
||||
query: Any = ...
|
||||
model: Type[django.db.models.base.Model] = ...
|
||||
opts: django.db.models.options.Options = ...
|
||||
lookup_opts: django.db.models.options.Options = ...
|
||||
root_queryset: django.db.models.query.QuerySet = ...
|
||||
list_display: List[str] = ...
|
||||
list_display_links: List[str] = ...
|
||||
list_filter: Tuple = ...
|
||||
date_hierarchy: None = ...
|
||||
search_fields: Tuple = ...
|
||||
list_select_related: bool = ...
|
||||
list_per_page: int = ...
|
||||
list_max_show_all: int = ...
|
||||
model_admin: django.contrib.admin.options.ModelAdmin = ...
|
||||
preserved_filters: str = ...
|
||||
sortable_by: Tuple[str] = ...
|
||||
page_num: int = ...
|
||||
show_all: bool = ...
|
||||
is_popup: bool = ...
|
||||
to_field: None = ...
|
||||
params: Dict[Any, Any] = ...
|
||||
list_editable: Tuple = ...
|
||||
query: str = ...
|
||||
queryset: Any = ...
|
||||
title: Any = ...
|
||||
pk_attname: Any = ...
|
||||
@@ -51,24 +47,30 @@ class ChangeList:
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
model: Type[Model],
|
||||
list_display: Union[
|
||||
List[str], List[Union[str, Callable]], Tuple[str, str, str, str]
|
||||
list_display: Union[List[Union[str, Callable]], Tuple[str]],
|
||||
list_display_links: Optional[
|
||||
Union[List[str], Tuple[str], List[Callable]]
|
||||
],
|
||||
list_display_links: Union[List[str], Tuple[str, str]],
|
||||
list_filter: Union[List[Type[SimpleListFilter]], List[str], Tuple],
|
||||
list_filter: Union[Tuple, List[Type[SimpleListFilter]], List[str]],
|
||||
date_hierarchy: Optional[str],
|
||||
search_fields: Union[List[str], Tuple],
|
||||
list_select_related: bool,
|
||||
search_fields: Union[Tuple, List[str]],
|
||||
list_select_related: Union[bool, Tuple],
|
||||
list_per_page: int,
|
||||
list_max_show_all: int,
|
||||
list_editable: Union[List[str], Tuple],
|
||||
model_admin: ModelAdmin,
|
||||
sortable_by: Any,
|
||||
sortable_by: Union[Tuple, List[Callable], List[str]],
|
||||
) -> None: ...
|
||||
def get_filters_params(self, params: None = ...) -> Dict[str, str]: ...
|
||||
def get_filters(self, request: WSGIRequest) -> Any: ...
|
||||
def get_filters(
|
||||
self, request: WSGIRequest
|
||||
) -> Tuple[List[ListFilter], bool, bool, bool]: ...
|
||||
def get_query_string(
|
||||
self, new_params: Any = ..., remove: Optional[List[str]] = ...
|
||||
self,
|
||||
new_params: Optional[
|
||||
Union[Dict[str, Union[str, int]], Dict[str, None]]
|
||||
] = ...,
|
||||
remove: Optional[List[str]] = ...,
|
||||
) -> str: ...
|
||||
result_count: Any = ...
|
||||
show_full_result_count: Any = ...
|
||||
@@ -79,11 +81,12 @@ class ChangeList:
|
||||
multi_page: Any = ...
|
||||
paginator: Any = ...
|
||||
def get_results(self, request: WSGIRequest) -> None: ...
|
||||
def _get_default_ordering(self) -> Union[List[str], Tuple[str], Tuple[str, str]]: ...
|
||||
def get_ordering_field(
|
||||
self, field_name: Union[str, Callable]
|
||||
) -> Optional[Union[str, CombinedExpression]]: ...
|
||||
def get_ordering(self, request: WSGIRequest, queryset: QuerySet) -> List[str]: ...
|
||||
) -> Optional[Union[CombinedExpression, str]]: ...
|
||||
def get_ordering(
|
||||
self, request: WSGIRequest, queryset: QuerySet
|
||||
) -> Union[List[Union[Combinable, str]], List[Union[OrderBy, str]]]: ...
|
||||
def get_ordering_field_columns(self) -> OrderedDict: ...
|
||||
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
||||
def apply_select_related(self, qs: QuerySet) -> QuerySet: ...
|
||||
|
||||
@@ -1,68 +1,40 @@
|
||||
# Stubs for django.contrib.admin.widgets (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django import forms
|
||||
from typing import Any, Optional
|
||||
|
||||
from datetime import datetime
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.db.models.fields.reverse_related import ForeignObjectRel, ManyToOneRel
|
||||
from django.forms.widgets import Media, Select
|
||||
from django.http.request import QueryDict
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple, Union
|
||||
from django import forms
|
||||
|
||||
|
||||
class FilteredSelectMultiple(forms.SelectMultiple):
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def media(self): ...
|
||||
verbose_name: Any = ...
|
||||
is_stacked: Any = ...
|
||||
def __init__(
|
||||
self, verbose_name: str, is_stacked: bool, attrs: None = ..., choices: Tuple = ...
|
||||
self,
|
||||
verbose_name: Any,
|
||||
is_stacked: Any,
|
||||
attrs: Optional[Any] = ...,
|
||||
choices: Any = ...,
|
||||
) -> None: ...
|
||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
||||
|
||||
class AdminDateWidget(forms.DateInput):
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def __init__(self, attrs: None = ..., format: None = ...) -> None: ...
|
||||
def media(self): ...
|
||||
def __init__(
|
||||
self, attrs: Optional[Any] = ..., format: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
|
||||
class AdminTimeWidget(forms.TimeInput):
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def __init__(self, attrs: None = ..., format: None = ...) -> None: ...
|
||||
def media(self): ...
|
||||
def __init__(
|
||||
self, attrs: Optional[Any] = ..., format: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
|
||||
class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
||||
template_name: str = ...
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
def get_context(
|
||||
self, name: str, value: Optional[datetime], attrs: Dict[str, Union[bool, str]]
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Any],
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
str,
|
||||
bool,
|
||||
Dict[str, Union[bool, str]],
|
||||
List[Dict[str, Union[str, bool, Dict[str, Union[bool, str]]]]],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
str,
|
||||
bool,
|
||||
Dict[str, str],
|
||||
List[Dict[str, Union[str, bool, Dict[str, str]]]],
|
||||
],
|
||||
],
|
||||
],
|
||||
]: ...
|
||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
||||
|
||||
class AdminRadioSelect(forms.RadioSelect):
|
||||
template_name: str = ...
|
||||
@@ -70,7 +42,7 @@ class AdminRadioSelect(forms.RadioSelect):
|
||||
class AdminFileWidget(forms.ClearableFileInput):
|
||||
template_name: str = ...
|
||||
|
||||
def url_params_from_lookup_dict(lookups: Dict[str, Union[str, int]]) -> Dict[str, str]: ...
|
||||
def url_params_from_lookup_dict(lookups: Any): ...
|
||||
|
||||
class ForeignKeyRawIdWidget(forms.TextInput):
|
||||
template_name: str = ...
|
||||
@@ -78,15 +50,15 @@ class ForeignKeyRawIdWidget(forms.TextInput):
|
||||
admin_site: Any = ...
|
||||
db: Any = ...
|
||||
def __init__(
|
||||
self, rel: ManyToOneRel, admin_site: AdminSite, attrs: None = ..., using: None = ...
|
||||
self,
|
||||
rel: Any,
|
||||
admin_site: Any,
|
||||
attrs: Optional[Any] = ...,
|
||||
using: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def get_context(
|
||||
self, name: str, value: None, attrs: Dict[str, Union[bool, str]]
|
||||
) -> Dict[
|
||||
str, Union[Dict[str, Union[str, bool, None, Dict[str, Union[bool, str]]]], str]
|
||||
]: ...
|
||||
def base_url_parameters(self) -> Dict[str, str]: ...
|
||||
def url_parameters(self) -> Dict[str, str]: ...
|
||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
||||
def base_url_parameters(self): ...
|
||||
def url_parameters(self): ...
|
||||
def label_and_url_for_value(self, value: Any): ...
|
||||
|
||||
class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
|
||||
@@ -111,48 +83,42 @@ class RelatedFieldWidgetWrapper(forms.Widget):
|
||||
admin_site: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
widget: Union[Select, AdminRadioSelect],
|
||||
rel: ForeignObjectRel,
|
||||
admin_site: AdminSite,
|
||||
can_add_related: Optional[bool] = ...,
|
||||
widget: Any,
|
||||
rel: Any,
|
||||
admin_site: Any,
|
||||
can_add_related: Optional[Any] = ...,
|
||||
can_change_related: bool = ...,
|
||||
can_delete_related: bool = ...,
|
||||
can_view_related: bool = ...,
|
||||
) -> None: ...
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> RelatedFieldWidgetWrapper: ...
|
||||
def __deepcopy__(self, memo: Any): ...
|
||||
@property
|
||||
def is_hidden(self) -> bool: ...
|
||||
def is_hidden(self): ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def get_related_url(self, info: Tuple[str, str], action: str, *args: Any) -> str: ...
|
||||
def get_context(
|
||||
self, name: str, value: Optional[Union[str, int]], attrs: Dict[str, str]
|
||||
) -> Dict[str, Union[bool, str]]: ...
|
||||
def value_from_datadict(
|
||||
self, data: QueryDict, files: MultiValueDict, name: str
|
||||
) -> Optional[str]: ...
|
||||
def media(self): ...
|
||||
def get_related_url(self, info: Any, action: Any, *args: Any): ...
|
||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
||||
def value_from_datadict(self, data: Any, files: Any, name: Any): ...
|
||||
def value_omitted_from_data(self, data: Any, files: Any, name: Any): ...
|
||||
def id_for_label(self, id_: str) -> str: ...
|
||||
def id_for_label(self, id_: Any): ...
|
||||
|
||||
class AdminTextareaWidget(forms.Textarea):
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
||||
|
||||
class AdminTextInputWidget(forms.TextInput):
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
||||
|
||||
class AdminEmailInputWidget(forms.EmailInput):
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
||||
|
||||
class AdminURLFieldWidget(forms.URLInput):
|
||||
template_name: str = ...
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
def get_context(
|
||||
self, name: str, value: None, attrs: Dict[str, str]
|
||||
) -> Dict[str, Union[Dict[str, Union[str, bool, None, Dict[str, str]]], str]]: ...
|
||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
||||
|
||||
class AdminIntegerFieldWidget(forms.NumberInput):
|
||||
class_name: str = ...
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
||||
|
||||
class AdminBigIntegerFieldWidget(AdminIntegerFieldWidget):
|
||||
class_name: str = ...
|
||||
@@ -168,24 +134,19 @@ class AutocompleteMixin:
|
||||
attrs: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
rel: ManyToOneRel,
|
||||
admin_site: AdminSite,
|
||||
attrs: None = ...,
|
||||
choices: Tuple = ...,
|
||||
using: None = ...,
|
||||
rel: Any,
|
||||
admin_site: Any,
|
||||
attrs: Optional[Any] = ...,
|
||||
choices: Any = ...,
|
||||
using: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def get_url(self) -> str: ...
|
||||
def get_url(self): ...
|
||||
def build_attrs(
|
||||
self, base_attrs: Dict[Any, Any], extra_attrs: Dict[str, str] = ...
|
||||
) -> Dict[str, str]: ...
|
||||
def optgroups(
|
||||
self, name: str, value: List[str], attr: Dict[str, str] = ...
|
||||
) -> Union[
|
||||
List[Tuple[None, List[Dict[str, Union[str, int, Set[str], Dict[str, bool]]]], int]],
|
||||
List[Tuple[None, List[Dict[str, Union[bool, str]]], int]],
|
||||
]: ...
|
||||
self, base_attrs: Any, extra_attrs: Optional[Any] = ...
|
||||
): ...
|
||||
def optgroups(self, name: Any, value: Any, attr: Optional[Any] = ...): ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def media(self): ...
|
||||
|
||||
class AutocompleteSelect(AutocompleteMixin, forms.Select): ...
|
||||
class AutocompleteSelectMultiple(AutocompleteMixin, forms.SelectMultiple): ...
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
# Stubs for django.contrib.admindocs.middleware (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .utils import get_view_name
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
from typing import Any
|
||||
from typing import Any, Callable, Dict, Optional, Tuple
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
from typing import Any, Callable, Dict, Optional, Tuple
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
from .utils import get_view_name
|
||||
|
||||
|
||||
class XViewMiddleware(MiddlewareMixin):
|
||||
get_response: None
|
||||
def process_view(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
# Stubs for django.contrib.admindocs.utils (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Callable
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
docutils_is_available: bool
|
||||
|
||||
@@ -12,7 +6,9 @@ def get_view_name(view_func: Callable) -> str: ...
|
||||
def trim_docstring(docstring: Any): ...
|
||||
def parse_docstring(docstring: Any): ...
|
||||
def parse_rst(
|
||||
text: Any, default_reference_context: Any, thing_being_parsed: Optional[Any] = ...
|
||||
text: Any,
|
||||
default_reference_context: Any,
|
||||
thing_being_parsed: Optional[Any] = ...,
|
||||
): ...
|
||||
|
||||
ROLES: Any
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
# Stubs for django.contrib.admindocs.views (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .utils import get_view_name
|
||||
from django.views.generic import TemplateView
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
from django.db.models.fields import Field
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from .utils import get_view_name
|
||||
|
||||
MODEL_METHODS_EXCLUDE: Any
|
||||
|
||||
@@ -33,8 +30,6 @@ class ViewIndexView(BaseAdminDocsView):
|
||||
|
||||
class ViewDetailView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
@staticmethod
|
||||
def _get_view_func(view: Any): ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class ModelIndexView(BaseAdminDocsView):
|
||||
@@ -50,8 +45,8 @@ class TemplateDetailView(BaseAdminDocsView):
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
def get_return_data_type(func_name: Any): ...
|
||||
def get_readable_field_data_type(field: Field) -> str: ...
|
||||
def get_readable_field_data_type(field: Union[str, Field]) -> str: ...
|
||||
def extract_views_from_urlpatterns(
|
||||
urlpatterns: Any, base: str = ..., namespace: Optional[Any] = ...
|
||||
): ...
|
||||
def simplify_regex(pattern: Any): ...
|
||||
def simplify_regex(pattern: str) -> str: ...
|
||||
|
||||
@@ -1,44 +1,39 @@
|
||||
# Stubs for django.contrib.auth (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .signals import user_logged_in, user_logged_out, user_login_failed
|
||||
from typing import Any, Optional
|
||||
from typing import Any, List, Optional, Type, Union
|
||||
|
||||
from django.contrib.auth.backends import ModelBackend
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.contrib.auth.models import AbstractUser, AnonymousUser
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.options import Options
|
||||
from django.http.request import HttpRequest
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
from typing import Any, Dict, List, Optional, Type, Union
|
||||
|
||||
from .signals import user_logged_in, user_logged_out, user_login_failed
|
||||
|
||||
SESSION_KEY: str
|
||||
BACKEND_SESSION_KEY: str
|
||||
HASH_SESSION_KEY: str
|
||||
REDIRECT_FIELD_NAME: str
|
||||
|
||||
def load_backend(path: str) -> object: ...
|
||||
def _get_backends(return_tuples: bool = ...) -> Any: ...
|
||||
def load_backend(path: str) -> ModelBackend: ...
|
||||
def get_backends() -> List[ModelBackend]: ...
|
||||
def _clean_credentials(
|
||||
credentials: Dict[str, Optional[str]]
|
||||
) -> Dict[str, Optional[str]]: ...
|
||||
def _get_user_session_key(request: HttpRequest) -> int: ...
|
||||
def authenticate(
|
||||
request: Optional[HttpRequest] = ..., **credentials: Any
|
||||
request: Any = ..., **credentials: Any
|
||||
) -> Optional[AbstractBaseUser]: ...
|
||||
def login(
|
||||
request: HttpRequest,
|
||||
user: User,
|
||||
user: AbstractBaseUser,
|
||||
backend: Optional[Union[str, Type[ModelBackend]]] = ...,
|
||||
) -> None: ...
|
||||
def logout(request: HttpRequest) -> None: ...
|
||||
def get_user_model() -> Type[Model]: ...
|
||||
def get_user(request: HttpRequest) -> Union[AnonymousUser, AbstractBaseUser]: ...
|
||||
def get_user(
|
||||
request: HttpRequest
|
||||
) -> Union[AbstractBaseUser, AnonymousUser]: ...
|
||||
def get_permission_codename(action: str, opts: Options) -> str: ...
|
||||
def update_session_auth_hash(request: WSGIRequest, user: SimpleLazyObject) -> None: ...
|
||||
def update_session_auth_hash(
|
||||
request: WSGIRequest, user: Union[SimpleLazyObject, AbstractUser]
|
||||
) -> None: ...
|
||||
|
||||
default_app_config: str
|
||||
|
||||
@@ -1,32 +1,121 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.fields.related import ManyToManyField
|
||||
from django.forms.models import ModelMultipleChoiceField
|
||||
from django.http.response import HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.http.response import HttpResponse
|
||||
from django.urls.resolvers import URLPattern
|
||||
from typing import Dict, List, Tuple, Union
|
||||
|
||||
class GroupAdmin:
|
||||
csrf_protect_m: Any
|
||||
sensitive_post_parameters_m: Any
|
||||
|
||||
class GroupAdmin(admin.ModelAdmin):
|
||||
admin_site: django.contrib.admin.sites.AdminSite
|
||||
formfield_overrides: Dict[
|
||||
Type[
|
||||
Union[
|
||||
django.db.models.fields.DateField,
|
||||
django.db.models.fields.TimeField,
|
||||
django.db.models.fields.TextField,
|
||||
django.db.models.fields.IntegerField,
|
||||
django.db.models.fields.CharField,
|
||||
django.db.models.fields.files.FileField,
|
||||
]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
Union[
|
||||
django.forms.fields.SplitDateTimeField,
|
||||
django.contrib.admin.widgets.AdminSplitDateTime,
|
||||
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,
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
model: Type[django.contrib.auth.models.Group]
|
||||
opts: django.db.models.options.Options
|
||||
search_fields: Any = ...
|
||||
ordering: Any = ...
|
||||
filter_horizontal: Any = ...
|
||||
def formfield_for_manytomany(
|
||||
self, db_field: ManyToManyField, request: WSGIRequest = ..., **kwargs
|
||||
self,
|
||||
db_field: ManyToManyField,
|
||||
request: WSGIRequest = ...,
|
||||
**kwargs: Any
|
||||
) -> ModelMultipleChoiceField: ...
|
||||
|
||||
class UserAdmin:
|
||||
def _add_view(
|
||||
self, request: WSGIRequest, form_url: str = ..., extra_context: None = ...
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
def add_view(
|
||||
self, request: WSGIRequest, form_url: str = ..., extra_context: None = ...
|
||||
): ...
|
||||
class UserAdmin(admin.ModelAdmin):
|
||||
admin_site: django.contrib.admin.sites.AdminSite
|
||||
formfield_overrides: Dict[
|
||||
Type[
|
||||
Union[
|
||||
django.db.models.fields.DateField,
|
||||
django.db.models.fields.TimeField,
|
||||
django.db.models.fields.TextField,
|
||||
django.db.models.fields.IntegerField,
|
||||
django.db.models.fields.CharField,
|
||||
django.db.models.fields.files.FileField,
|
||||
]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
Union[
|
||||
django.forms.fields.SplitDateTimeField,
|
||||
django.contrib.admin.widgets.AdminSplitDateTime,
|
||||
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,
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
model: Type[django.contrib.auth.models.User]
|
||||
opts: django.db.models.options.Options
|
||||
add_form_template: str = ...
|
||||
change_user_password_template: Any = ...
|
||||
fieldsets: Any = ...
|
||||
add_fieldsets: Any = ...
|
||||
form: Any = ...
|
||||
add_form: Any = ...
|
||||
change_password_form: Any = ...
|
||||
list_display: Any = ...
|
||||
list_filter: Any = ...
|
||||
search_fields: Any = ...
|
||||
ordering: Any = ...
|
||||
filter_horizontal: Any = ...
|
||||
def get_fieldsets(
|
||||
self, request: WSGIRequest, obj: None = ...
|
||||
) -> Tuple[Tuple[None, Dict[str, Union[Tuple[str], Tuple[str, str, str]]]]]: ...
|
||||
) -> Tuple[Tuple[None, Dict[str, Tuple[str]]]]: ...
|
||||
def get_form(
|
||||
self, request: Any, obj: Optional[Any] = ..., **kwargs: Any
|
||||
): ...
|
||||
def get_urls(self) -> List[URLPattern]: ...
|
||||
def lookup_allowed(self, lookup: str, value: str) -> bool: ...
|
||||
def response_add(
|
||||
self, request: WSGIRequest, obj: User, post_url_continue: None = ...
|
||||
) -> HttpResponseRedirect: ...
|
||||
def add_view(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
form_url: str = ...,
|
||||
extra_context: None = ...,
|
||||
) -> Any: ...
|
||||
def user_change_password(
|
||||
self, request: WSGIRequest, id: str, form_url: str = ...
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
) -> HttpResponse: ...
|
||||
def response_add(
|
||||
self, request: WSGIRequest, obj: User, post_url_continue: None = ...
|
||||
) -> HttpResponse: ...
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
# Stubs for django.contrib.auth.apps (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
from .checks import check_models_permissions, check_user_model
|
||||
from .management import create_permissions
|
||||
from .signals import user_logged_in
|
||||
from django.apps import AppConfig
|
||||
from typing import Any
|
||||
|
||||
|
||||
class AuthConfig(AppConfig):
|
||||
apps: None
|
||||
label: str
|
||||
models: None
|
||||
models_module: None
|
||||
module: Any
|
||||
path: str
|
||||
name: str = ...
|
||||
verbose_name: Any = ...
|
||||
def ready(self) -> None: ...
|
||||
|
||||
@@ -1,42 +1,52 @@
|
||||
from typing import Any, Optional, Set, Union
|
||||
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.query import QuerySet
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Optional, Set, Union
|
||||
|
||||
class AllowAllUsersModelBackend:
|
||||
def user_can_authenticate(self, user: User) -> bool: ...
|
||||
|
||||
class AllowAllUsersRemoteUserBackend:
|
||||
def user_can_authenticate(self, user: User) -> bool: ...
|
||||
UserModel: Any
|
||||
|
||||
class ModelBackend:
|
||||
def _get_group_permissions(self, user_obj: User) -> QuerySet: ...
|
||||
def _get_permissions(self, user_obj: User, obj: None, from_name: str) -> Set[str]: ...
|
||||
def _get_user_permissions(self, user_obj: User) -> QuerySet: ...
|
||||
def authenticate(
|
||||
self,
|
||||
request: Optional[HttpRequest],
|
||||
username: Optional[str] = ...,
|
||||
request: Any,
|
||||
username: Optional[Union[str, int]] = ...,
|
||||
password: Optional[str] = ...,
|
||||
**kwargs,
|
||||
) -> Optional[User]: ...
|
||||
def get_all_permissions(self, user_obj: User, obj: Optional[str] = ...) -> Set[str]: ...
|
||||
def get_group_permissions(self, user_obj: User, obj: None = ...) -> Set[str]: ...
|
||||
def get_user(self, user_id: int) -> User: ...
|
||||
def get_user_permissions(self, user_obj: User, obj: None = ...) -> Set[str]: ...
|
||||
def has_module_perms(
|
||||
self, user_obj: Union[AnonymousUser, User], app_label: str
|
||||
**kwargs: Any
|
||||
) -> Optional[AbstractBaseUser]: ...
|
||||
def user_can_authenticate(
|
||||
self, user: Optional[AbstractBaseUser]
|
||||
) -> bool: ...
|
||||
def get_user_permissions(
|
||||
self, user_obj: AbstractBaseUser, obj: None = ...
|
||||
) -> Set[str]: ...
|
||||
def get_group_permissions(
|
||||
self, user_obj: AbstractBaseUser, obj: None = ...
|
||||
) -> Set[str]: ...
|
||||
def get_all_permissions(
|
||||
self, user_obj: AbstractBaseUser, obj: Optional[str] = ...
|
||||
) -> Set[str]: ...
|
||||
def has_perm(
|
||||
self, user_obj: Union[AnonymousUser, User], perm: str, obj: None = ...
|
||||
self,
|
||||
user_obj: Union[AnonymousUser, AbstractBaseUser],
|
||||
perm: str,
|
||||
obj: Optional[str] = ...,
|
||||
) -> bool: ...
|
||||
def user_can_authenticate(self, user: Optional[AbstractBaseUser]) -> bool: ...
|
||||
def has_module_perms(
|
||||
self, user_obj: Union[AbstractBaseUser, AnonymousUser], app_label: str
|
||||
) -> bool: ...
|
||||
def get_user(self, user_id: int) -> AbstractBaseUser: ...
|
||||
|
||||
class RemoteUserBackend:
|
||||
class AllowAllUsersModelBackend(ModelBackend):
|
||||
def user_can_authenticate(self, user: AbstractBaseUser) -> bool: ...
|
||||
|
||||
class RemoteUserBackend(ModelBackend):
|
||||
create_unknown_user: bool = ...
|
||||
def authenticate(
|
||||
self, request: WSGIRequest, remote_user: Optional[str]
|
||||
) -> Optional[User]: ...
|
||||
def clean_username(self, username: str) -> str: ...
|
||||
def configure_user(self, user: User) -> User: ...
|
||||
|
||||
class AllowAllUsersRemoteUserBackend(RemoteUserBackend):
|
||||
def user_can_authenticate(self, user: User) -> bool: ...
|
||||
|
||||
@@ -1,25 +1,44 @@
|
||||
from typing import Optional
|
||||
from typing import Any, Optional, Tuple, Union
|
||||
|
||||
class AbstractBaseUser:
|
||||
def __str__(self) -> str: ...
|
||||
def check_password(self, raw_password: str) -> bool: ...
|
||||
def clean(self) -> None: ...
|
||||
from django.db import models
|
||||
|
||||
|
||||
class BaseUserManager(models.Manager):
|
||||
creation_counter: int
|
||||
model: None
|
||||
name: None
|
||||
@classmethod
|
||||
def get_email_field_name(cls) -> str: ...
|
||||
def get_session_auth_hash(self) -> str: ...
|
||||
def normalize_email(cls, email: Optional[str]) -> str: ...
|
||||
def make_random_password(
|
||||
self, length: int = ..., allowed_chars: str = ...
|
||||
) -> str: ...
|
||||
def get_by_natural_key(
|
||||
self, username: Optional[str]
|
||||
) -> AbstractBaseUser: ...
|
||||
|
||||
class AbstractBaseUser(models.Model):
|
||||
password: str = ...
|
||||
last_login: None = ...
|
||||
is_active: bool = ...
|
||||
REQUIRED_FIELDS: Any = ...
|
||||
class Meta:
|
||||
abstract: bool = ...
|
||||
def get_username(self) -> str: ...
|
||||
def has_usable_password(self) -> bool: ...
|
||||
def clean(self) -> None: ...
|
||||
def save(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def natural_key(self) -> Tuple[str]: ...
|
||||
@property
|
||||
def is_anonymous(self) -> bool: ...
|
||||
@property
|
||||
def is_authenticated(self) -> bool: ...
|
||||
@classmethod
|
||||
def normalize_username(cls, username: str) -> str: ...
|
||||
def save(self, *args, **kwargs) -> None: ...
|
||||
def set_password(self, raw_password: Optional[str]) -> None: ...
|
||||
def check_password(self, raw_password: str) -> bool: ...
|
||||
def set_unusable_password(self) -> None: ...
|
||||
|
||||
class BaseUserManager:
|
||||
def get_by_natural_key(self, username: Optional[str]) -> AbstractBaseUser: ...
|
||||
def has_usable_password(self) -> bool: ...
|
||||
def get_session_auth_hash(self) -> str: ...
|
||||
@classmethod
|
||||
def normalize_email(cls, email: Optional[str]) -> str: ...
|
||||
def get_email_field_name(cls) -> str: ...
|
||||
@classmethod
|
||||
def normalize_username(
|
||||
cls, username: Union[str, int]
|
||||
) -> Union[str, int]: ...
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
# Stubs for django.contrib.auth.checks (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from django.core.checks.messages import CheckMessage
|
||||
|
||||
from .management import _get_builtin_permissions
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, List
|
||||
|
||||
def check_user_model(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
def check_models_permissions(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
def check_user_model(
|
||||
app_configs: None = ..., **kwargs: Any
|
||||
) -> List[CheckMessage]: ...
|
||||
def check_models_permissions(
|
||||
app_configs: None = ..., **kwargs: Any
|
||||
) -> List[Any]: ...
|
||||
|
||||
@@ -1,25 +1,27 @@
|
||||
# Stubs for django.contrib.auth.context_processors (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Dict, Union
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
|
||||
|
||||
class PermLookupDict:
|
||||
def __init__(self, user: object, app_label: str) -> None: ...
|
||||
def __repr__(self): ...
|
||||
app_label: django.utils.safestring.SafeText
|
||||
user: django.utils.functional.SimpleLazyObject
|
||||
def __init__(self, user: SimpleLazyObject, app_label: str) -> None: ...
|
||||
def __getitem__(self, perm_name: str) -> bool: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def __iter__(self) -> Any: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
|
||||
class PermWrapper:
|
||||
user: Any = ...
|
||||
def __init__(self, user: object) -> None: ...
|
||||
user: django.utils.functional.SimpleLazyObject = ...
|
||||
def __init__(
|
||||
self, user: Union[SimpleLazyObject, AnonymousUser, User]
|
||||
) -> None: ...
|
||||
def __getitem__(self, app_label: str) -> PermLookupDict: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def __contains__(self, perm_name: str) -> bool: ...
|
||||
def __iter__(self) -> Any: ...
|
||||
def __contains__(self, perm_name: Union[str, bool]) -> bool: ...
|
||||
|
||||
def auth(request: HttpRequest) -> Dict[str, Union[PermWrapper, AnonymousUser, User]]: ...
|
||||
def auth(
|
||||
request: HttpRequest
|
||||
) -> Dict[str, Union[SimpleLazyObject, PermWrapper, User, AnonymousUser]]: ...
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
# Stubs for django.contrib.auth.decorators (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Callable, List, Optional, Set, Union
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Callable, List, Optional, Union
|
||||
|
||||
def user_passes_test(
|
||||
test_func: Callable, login_url: Optional[str] = ..., redirect_field_name: str = ...
|
||||
test_func: Callable,
|
||||
login_url: Optional[str] = ...,
|
||||
redirect_field_name: str = ...,
|
||||
) -> Callable: ...
|
||||
def login_required(
|
||||
function: Optional[Callable] = ...,
|
||||
redirect_field_name: str = ...,
|
||||
login_url: None = ...,
|
||||
login_url: Optional[str] = ...,
|
||||
) -> Callable: ...
|
||||
def permission_required(
|
||||
perm: Union[str, List[str]], login_url: None = ..., raise_exception: bool = ...
|
||||
perm: Union[str, List[str], Set[str]],
|
||||
login_url: None = ...,
|
||||
raise_exception: bool = ...,
|
||||
) -> Callable: ...
|
||||
|
||||
@@ -1,75 +1,198 @@
|
||||
from django.contrib.auth.models import User
|
||||
from typing import Any, Dict, Iterator, List, Optional, Union
|
||||
|
||||
from django import forms
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.contrib.auth.models import AbstractUser, User
|
||||
from django.contrib.auth.tokens import PasswordResetTokenGenerator
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from typing import Any, Dict, Iterator, List, Optional, Union
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
|
||||
class AdminPasswordChangeForm:
|
||||
def __init__(self, user: User, *args, **kwargs) -> None: ...
|
||||
@property
|
||||
def changed_data(self) -> List[str]: ...
|
||||
UserModel: Any
|
||||
|
||||
class ReadOnlyPasswordHashWidget(forms.Widget):
|
||||
attrs: Dict[Any, Any]
|
||||
template_name: str = ...
|
||||
def get_context(
|
||||
self, name: str, value: Optional[str], attrs: Dict[str, str]
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[str, bool, None, Dict[Any, Any]]],
|
||||
List[Dict[str, str]],
|
||||
Dict[str, Union[str, bool, None, Dict[str, str]]],
|
||||
Dict[str, Union[str, bool, Dict[str, str]]],
|
||||
],
|
||||
]: ...
|
||||
|
||||
class ReadOnlyPasswordHashField(forms.Field):
|
||||
widget: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def bound_data(self, data: None, initial: str) -> str: ...
|
||||
def has_changed(self, initial: str, data: Optional[str]) -> bool: ...
|
||||
|
||||
class UsernameField(forms.CharField):
|
||||
def to_python(self, value: Optional[str]) -> str: ...
|
||||
|
||||
class UserCreationForm(forms.ModelForm):
|
||||
auto_id: str
|
||||
data: Dict[str, str]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[Any, Any]
|
||||
instance: django.contrib.auth.models.User
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
error_messages: Any = ...
|
||||
password1: Any = ...
|
||||
password2: Any = ...
|
||||
class Meta:
|
||||
model: Any = ...
|
||||
fields: Any = ...
|
||||
field_classes: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def clean_password2(self) -> str: ...
|
||||
def save(self, commit: bool = ...) -> User: ...
|
||||
|
||||
class AuthenticationForm:
|
||||
def __init__(self, request: object = ..., *args, **kwargs) -> None: ...
|
||||
def clean(self) -> Dict[str, str]: ...
|
||||
def confirm_login_allowed(self, user: User) -> None: ...
|
||||
def get_invalid_login_error(self) -> ValidationError: ...
|
||||
def get_user(self) -> User: ...
|
||||
class UserChangeForm(forms.ModelForm):
|
||||
auto_id: str
|
||||
data: Dict[Any, Any]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[str, Optional[Union[int, str, datetime.datetime, List[Any]]]]
|
||||
instance: django.contrib.auth.models.User
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
password: Any = ...
|
||||
class Meta:
|
||||
model: Any = ...
|
||||
fields: str = ...
|
||||
field_classes: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def clean_password(self) -> str: ...
|
||||
|
||||
class PasswordChangeForm:
|
||||
def clean_old_password(self) -> str: ...
|
||||
|
||||
class PasswordResetForm:
|
||||
def get_users(self, email: str) -> Iterator[Any]: ...
|
||||
def save(
|
||||
self,
|
||||
domain_override: None = ...,
|
||||
subject_template_name: str = ...,
|
||||
email_template_name: str = ...,
|
||||
use_https: bool = ...,
|
||||
token_generator: PasswordResetTokenGenerator = ...,
|
||||
from_email: None = ...,
|
||||
request: Optional[WSGIRequest] = ...,
|
||||
html_email_template_name: None = ...,
|
||||
extra_email_context: Optional[Dict[str, str]] = ...,
|
||||
class AuthenticationForm(forms.Form):
|
||||
auto_id: str
|
||||
data: django.http.request.QueryDict
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: django.utils.datastructures.MultiValueDict
|
||||
initial: Dict[Any, Any]
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
username: Any = ...
|
||||
password: Any = ...
|
||||
error_messages: Any = ...
|
||||
request: django.core.handlers.wsgi.WSGIRequest = ...
|
||||
user_cache: None = ...
|
||||
username_field: Any = ...
|
||||
def __init__(
|
||||
self, request: Any = ..., *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def clean(self) -> Dict[str, str]: ...
|
||||
def confirm_login_allowed(self, user: AbstractBaseUser) -> None: ...
|
||||
def get_user(self) -> User: ...
|
||||
def get_invalid_login_error(self) -> ValidationError: ...
|
||||
|
||||
class PasswordResetForm(forms.Form):
|
||||
auto_id: str
|
||||
data: Dict[Any, Any]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[Any, Any]
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
email: Any = ...
|
||||
def send_mail(
|
||||
self,
|
||||
subject_template_name: str,
|
||||
email_template_name: str,
|
||||
context: Dict[str, Union[str, User]],
|
||||
context: Dict[str, Union[str, AbstractBaseUser]],
|
||||
from_email: Optional[str],
|
||||
to_email: str,
|
||||
html_email_template_name: None = ...,
|
||||
html_email_template_name: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def get_users(self, email: str) -> Iterator[Any]: ...
|
||||
def save(
|
||||
self,
|
||||
domain_override: Optional[str] = ...,
|
||||
subject_template_name: str = ...,
|
||||
email_template_name: str = ...,
|
||||
use_https: bool = ...,
|
||||
token_generator: PasswordResetTokenGenerator = ...,
|
||||
from_email: Optional[str] = ...,
|
||||
request: Optional[WSGIRequest] = ...,
|
||||
html_email_template_name: Optional[str] = ...,
|
||||
extra_email_context: Optional[Dict[str, str]] = ...,
|
||||
) -> None: ...
|
||||
|
||||
class ReadOnlyPasswordHashField:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def has_changed(self, initial: str, data: None) -> bool: ...
|
||||
|
||||
class ReadOnlyPasswordHashWidget:
|
||||
def get_context(
|
||||
self, name: str, value: str, attrs: Dict[str, str]
|
||||
) -> Dict[
|
||||
str, Union[Dict[str, Union[str, bool, Dict[str, str]]], List[Dict[str, str]]]
|
||||
]: ...
|
||||
|
||||
class SetPasswordForm:
|
||||
def __init__(self, user: Optional[User], *args, **kwargs) -> None: ...
|
||||
class SetPasswordForm(forms.Form):
|
||||
auto_id: str
|
||||
data: Dict[Any, Any]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[Any, Any]
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
error_messages: Any = ...
|
||||
new_password1: Any = ...
|
||||
new_password2: Any = ...
|
||||
user: django.contrib.auth.models.User = ...
|
||||
def __init__(
|
||||
self,
|
||||
user: Optional[Union[SimpleLazyObject, AbstractBaseUser]],
|
||||
*args: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def clean_new_password2(self) -> str: ...
|
||||
def save(self, commit: bool = ...) -> User: ...
|
||||
def save(
|
||||
self, commit: bool = ...
|
||||
) -> Union[AbstractBaseUser, SimpleLazyObject]: ...
|
||||
|
||||
class UserChangeForm:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def clean_password(self) -> str: ...
|
||||
class PasswordChangeForm(SetPasswordForm):
|
||||
auto_id: str
|
||||
data: Dict[Any, Any]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[Any, Any]
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
user: django.contrib.auth.models.User
|
||||
error_messages: Any = ...
|
||||
old_password: Any = ...
|
||||
field_order: Any = ...
|
||||
def clean_old_password(self) -> str: ...
|
||||
|
||||
class UserCreationForm:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def _post_clean(self) -> None: ...
|
||||
class AdminPasswordChangeForm(forms.Form):
|
||||
auto_id: str
|
||||
data: Dict[Any, Any]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[Any, Any]
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
error_messages: Any = ...
|
||||
required_css_class: str = ...
|
||||
password1: Any = ...
|
||||
password2: Any = ...
|
||||
user: django.contrib.auth.models.User = ...
|
||||
def __init__(
|
||||
self, user: AbstractUser, *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def clean_password2(self) -> str: ...
|
||||
def save(self, commit: bool = ...) -> User: ...
|
||||
|
||||
class UsernameField:
|
||||
def to_python(self, value: Optional[str]) -> str: ...
|
||||
def save(self, commit: bool = ...) -> AbstractUser: ...
|
||||
@property
|
||||
def changed_data(self) -> List[str]: ...
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
from typing import Any, Dict
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
def check_password(environ: Dict[Any, Any], username: str, password: str): ...
|
||||
def groups_for_user(environ: Dict[Any, Any], username: str): ...
|
||||
UserModel: Any
|
||||
|
||||
def check_password(
|
||||
environ: Dict[Any, Any], username: str, password: str
|
||||
) -> Any: ...
|
||||
def groups_for_user(environ: Dict[Any, Any], username: str) -> Any: ...
|
||||
|
||||
@@ -1,28 +1,20 @@
|
||||
# Stubs for django.contrib.auth.hashers (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from collections import OrderedDict
|
||||
from typing import Callable, Dict, List, Optional, Union
|
||||
from typing import Any, Callable, Dict, List, Optional
|
||||
|
||||
UNUSABLE_PASSWORD_PREFIX: str
|
||||
UNUSABLE_PASSWORD_SUFFIX_LENGTH: int
|
||||
|
||||
def is_password_usable(encoded: Optional[str]) -> bool: ...
|
||||
def check_password(
|
||||
password: str, encoded: str, setter: Optional[Callable] = ..., preferred: str = ...
|
||||
password: Optional[str],
|
||||
encoded: str,
|
||||
setter: Optional[Callable] = ...,
|
||||
preferred: str = ...,
|
||||
) -> bool: ...
|
||||
def make_password(
|
||||
password: Optional[str], salt: Optional[str] = ..., hasher: str = ...
|
||||
) -> str: ...
|
||||
def get_hashers() -> Union[
|
||||
List[UnsaltedMD5PasswordHasher],
|
||||
List[MD5PasswordHasher],
|
||||
List[BasePasswordHasher],
|
||||
List[PBKDF2PasswordHasher],
|
||||
]: ...
|
||||
def get_hashers() -> List[BasePasswordHasher]: ...
|
||||
def get_hashers_by_algorithm() -> Dict[str, BasePasswordHasher]: ...
|
||||
def reset_hashers(**kwargs: Any) -> None: ...
|
||||
def get_hasher(algorithm: str = ...) -> BasePasswordHasher: ...
|
||||
@@ -32,11 +24,10 @@ def mask_hash(hash: str, show: int = ..., char: str = ...) -> str: ...
|
||||
class BasePasswordHasher:
|
||||
algorithm: Any = ...
|
||||
library: Any = ...
|
||||
def _load_library(self): ...
|
||||
def salt(self) -> str: ...
|
||||
def verify(self, password: Any, encoded: Any) -> None: ...
|
||||
def encode(self, password: Any, salt: Any) -> None: ...
|
||||
def safe_summary(self, encoded: str) -> None: ...
|
||||
def verify(self, password: str, encoded: str) -> Any: ...
|
||||
def encode(self, password: str, salt: str) -> Any: ...
|
||||
def safe_summary(self, encoded: str) -> Any: ...
|
||||
def must_update(self, encoded: str) -> bool: ...
|
||||
def harden_runtime(self, password: str, encoded: str) -> None: ...
|
||||
|
||||
@@ -44,11 +35,13 @@ class PBKDF2PasswordHasher(BasePasswordHasher):
|
||||
algorithm: str = ...
|
||||
iterations: int = ...
|
||||
digest: Any = ...
|
||||
def encode(self, password: str, salt: str, iterations: Optional[int] = ...) -> str: ...
|
||||
def encode(
|
||||
self, password: str, salt: str, iterations: Optional[int] = ...
|
||||
) -> str: ...
|
||||
def verify(self, password: str, encoded: str) -> bool: ...
|
||||
def safe_summary(self, encoded: Any): ...
|
||||
def safe_summary(self, encoded: str) -> OrderedDict: ...
|
||||
def must_update(self, encoded: str) -> bool: ...
|
||||
def harden_runtime(self, password: Any, encoded: Any) -> None: ...
|
||||
def harden_runtime(self, password: str, encoded: str) -> None: ...
|
||||
|
||||
class PBKDF2SHA1PasswordHasher(PBKDF2PasswordHasher):
|
||||
algorithm: str = ...
|
||||
@@ -65,7 +58,6 @@ class Argon2PasswordHasher(BasePasswordHasher):
|
||||
def safe_summary(self, encoded: Any): ...
|
||||
def must_update(self, encoded: Any): ...
|
||||
def harden_runtime(self, password: Any, encoded: Any) -> None: ...
|
||||
def _decode(self, encoded: Any): ...
|
||||
|
||||
class BCryptSHA256PasswordHasher(BasePasswordHasher):
|
||||
algorithm: str = ...
|
||||
@@ -107,7 +99,7 @@ class UnsaltedSHA1PasswordHasher(BasePasswordHasher):
|
||||
|
||||
class UnsaltedMD5PasswordHasher(BasePasswordHasher):
|
||||
algorithm: str = ...
|
||||
def salt(self): ...
|
||||
def salt(self) -> str: ...
|
||||
def encode(self, password: str, salt: str) -> str: ...
|
||||
def verify(self, password: str, encoded: str) -> bool: ...
|
||||
def safe_summary(self, encoded: Any): ...
|
||||
|
||||
@@ -1,23 +1,16 @@
|
||||
# Stubs for django.contrib.auth.management (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
from django.apps.registry import Apps
|
||||
from django.db.models.options import Options
|
||||
from typing import List, Tuple
|
||||
|
||||
def _get_all_permissions(opts: Options) -> List[Tuple[str, str]]: ...
|
||||
def _get_builtin_permissions(opts: Options) -> List[Tuple[str, str]]: ...
|
||||
|
||||
def create_permissions(
|
||||
app_config: AppConfig,
|
||||
verbosity: int = ...,
|
||||
interactive: bool = ...,
|
||||
using: str = ...,
|
||||
apps: Apps = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def get_system_username() -> str: ...
|
||||
def get_default_username(check_db: bool = ...) -> str: ...
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
from django.core.management.base import CommandParser
|
||||
from typing import Any, Optional
|
||||
|
||||
class Command:
|
||||
from django.core.management.base import BaseCommand, CommandParser
|
||||
|
||||
UserModel: Any
|
||||
|
||||
class Command(BaseCommand):
|
||||
stderr: django.core.management.base.OutputWrapper
|
||||
stdout: django.core.management.base.OutputWrapper
|
||||
style: django.core.management.color.Style
|
||||
help: str = ...
|
||||
requires_migrations_checks: bool = ...
|
||||
requires_system_checks: bool = ...
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, *args, **options) -> str: ...
|
||||
def handle(self, *args: Any, **options: Any) -> str: ...
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
from django.core.management.base import CommandParser
|
||||
from django.db.models.fields import CharField
|
||||
from django.db.models.fields.related import ForeignKey
|
||||
from typing import Optional, Union
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
class Command:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
from django.core.management.base import BaseCommand, CommandParser
|
||||
from django.db.models.fields import Field
|
||||
|
||||
|
||||
class NotRunningInTTYException(Exception): ...
|
||||
|
||||
class Command(BaseCommand):
|
||||
stderr: django.core.management.base.OutputWrapper
|
||||
stdout: django.core.management.base.OutputWrapper
|
||||
style: django.core.management.color.Style
|
||||
help: str = ...
|
||||
requires_migrations_checks: bool = ...
|
||||
stealth_options: Any = ...
|
||||
UserModel: Any = ...
|
||||
username_field: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def execute(self, *args, **options) -> None: ...
|
||||
stdin: Any = ...
|
||||
def execute(self, *args: Any, **options: Any) -> None: ...
|
||||
def handle(self, *args: Any, **options: Any) -> None: ...
|
||||
def get_input_data(
|
||||
self,
|
||||
field: Union[CharField, related.ForeignKey],
|
||||
message: str,
|
||||
default: Optional[str] = ...,
|
||||
) -> Optional[str]: ...
|
||||
def handle(self, *args, **options) -> None: ...
|
||||
self, field: Field, message: str, default: Optional[str] = ...
|
||||
) -> Optional[Union[str, int]]: ...
|
||||
|
||||
@@ -1,14 +1,24 @@
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Union
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
def get_user(request: HttpRequest) -> Union[AnonymousUser, User]: ...
|
||||
|
||||
class AuthenticationMiddleware:
|
||||
def get_user(request: WSGIRequest) -> Union[AnonymousUser, User]: ...
|
||||
|
||||
class AuthenticationMiddleware(MiddlewareMixin):
|
||||
get_response: Callable
|
||||
def process_request(self, request: HttpRequest) -> None: ...
|
||||
|
||||
class RemoteUserMiddleware:
|
||||
def _remove_invalid_user(self, request: WSGIRequest) -> None: ...
|
||||
def clean_username(self, username: str, request: WSGIRequest) -> str: ...
|
||||
class RemoteUserMiddleware(MiddlewareMixin):
|
||||
get_response: Callable
|
||||
header: str = ...
|
||||
force_logout_if_no_header: bool = ...
|
||||
def process_request(self, request: WSGIRequest) -> None: ...
|
||||
def clean_username(self, username: str, request: WSGIRequest) -> str: ...
|
||||
|
||||
class PersistentRemoteUserMiddleware(RemoteUserMiddleware):
|
||||
get_response: Callable
|
||||
force_logout_if_no_header: bool = ...
|
||||
|
||||
@@ -1,18 +1,35 @@
|
||||
from typing import Any, Callable, List, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
from typing import Callable, List
|
||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||
|
||||
|
||||
class AccessMixin:
|
||||
login_url: Any = ...
|
||||
permission_denied_message: str = ...
|
||||
raise_exception: bool = ...
|
||||
redirect_field_name: Any = ...
|
||||
def get_login_url(self) -> str: ...
|
||||
def get_permission_denied_message(self) -> str: ...
|
||||
def get_redirect_field_name(self) -> str: ...
|
||||
def handle_no_permission(self): ...
|
||||
def handle_no_permission(self) -> HttpResponseRedirect: ...
|
||||
|
||||
class LoginRequiredMixin:
|
||||
def dispatch(self, request: WSGIRequest, *args, **kwargs): ...
|
||||
class LoginRequiredMixin(AccessMixin):
|
||||
def dispatch(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
|
||||
class PermissionRequiredMixin:
|
||||
def dispatch(self, request: WSGIRequest, *args, **kwargs) -> HttpResponse: ...
|
||||
class PermissionRequiredMixin(AccessMixin):
|
||||
permission_required: Any = ...
|
||||
def get_permission_required(self) -> List[str]: ...
|
||||
def has_permission(self) -> bool: ...
|
||||
def dispatch(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
|
||||
class UserPassesTestMixin:
|
||||
class UserPassesTestMixin(AccessMixin):
|
||||
def test_func(self) -> None: ...
|
||||
def get_test_func(self) -> Callable: ...
|
||||
def dispatch(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
|
||||
@@ -1,65 +1,160 @@
|
||||
from typing import List, Optional, Set, Tuple, Type, Union
|
||||
from typing import Any, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
def _user_get_all_permissions(user: User, obj: Optional[str]) -> Set[str]: ...
|
||||
def _user_has_module_perms(user: Union[AnonymousUser, User], app_label: str) -> bool: ...
|
||||
def _user_has_perm(
|
||||
user: Union[AnonymousUser, User], perm: str, obj: Optional[str]
|
||||
) -> bool: ...
|
||||
def update_last_login(sender: Type[User], user: User, **kwargs) -> None: ...
|
||||
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
|
||||
from django.db import models
|
||||
from django.db.models.manager import EmptyManager
|
||||
|
||||
class AbstractUser:
|
||||
def clean(self) -> None: ...
|
||||
def get_short_name(self) -> str: ...
|
||||
from .validators import UnicodeUsernameValidator
|
||||
|
||||
class AnonymousUser:
|
||||
def __str__(self) -> str: ...
|
||||
def delete(self): ...
|
||||
def get_username(self) -> str: ...
|
||||
def has_module_perms(self, module: str) -> bool: ...
|
||||
def has_perm(self, perm: str, obj: None = ...) -> bool: ...
|
||||
def has_perms(
|
||||
self, perm_list: Union[List[str], Tuple[str]], obj: None = ...
|
||||
) -> bool: ...
|
||||
@property
|
||||
def is_anonymous(self) -> bool: ...
|
||||
@property
|
||||
def is_authenticated(self) -> bool: ...
|
||||
def set_password(self, raw_password: str): ...
|
||||
|
||||
class Group:
|
||||
def __str__(self) -> str: ...
|
||||
def update_last_login(
|
||||
sender: Type[AbstractBaseUser], user: AbstractBaseUser, **kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
class GroupManager:
|
||||
def get_by_natural_key(self, name: str) -> Group: ...
|
||||
|
||||
class Permission:
|
||||
def __str__(self) -> str: ...
|
||||
def natural_key(self) -> Tuple[str, str, str]: ...
|
||||
|
||||
class PermissionManager:
|
||||
class PermissionManager(models.Manager):
|
||||
creation_counter: int
|
||||
model: None
|
||||
name: None
|
||||
use_in_migrations: bool = ...
|
||||
def get_by_natural_key(
|
||||
self, codename: str, app_label: str, model: str
|
||||
) -> Permission: ...
|
||||
|
||||
class PermissionsMixin:
|
||||
def get_all_permissions(self, obj: None = ...) -> Set[str]: ...
|
||||
def has_module_perms(self, app_label: str) -> bool: ...
|
||||
def has_perm(self, perm: str, obj: None = ...) -> bool: ...
|
||||
def has_perms(
|
||||
self, perm_list: Union[List[str], Tuple[str]], obj: None = ...
|
||||
) -> bool: ...
|
||||
class Permission(models.Model):
|
||||
content_type_id: int
|
||||
id: int
|
||||
name: str = ...
|
||||
content_type: Any = ...
|
||||
codename: str = ...
|
||||
objects: Any = ...
|
||||
class Meta:
|
||||
verbose_name: Any = ...
|
||||
verbose_name_plural: Any = ...
|
||||
unique_together: Any = ...
|
||||
ordering: Any = ...
|
||||
def natural_key(self) -> Tuple[str, str, str]: ...
|
||||
|
||||
class UserManager:
|
||||
def _create_user(
|
||||
self, username: str, email: Optional[str], password: Optional[str], **extra_fields
|
||||
) -> User: ...
|
||||
def create_superuser(
|
||||
self, username: str, email: str, password: Optional[str], **extra_fields
|
||||
) -> User: ...
|
||||
class GroupManager(models.Manager):
|
||||
creation_counter: int
|
||||
model: None
|
||||
name: None
|
||||
use_in_migrations: bool = ...
|
||||
def get_by_natural_key(self, name: str) -> Group: ...
|
||||
|
||||
class Group(models.Model):
|
||||
id: None
|
||||
name: str = ...
|
||||
permissions: Any = ...
|
||||
objects: Any = ...
|
||||
class Meta:
|
||||
verbose_name: Any = ...
|
||||
verbose_name_plural: Any = ...
|
||||
def natural_key(self): ...
|
||||
|
||||
class UserManager(BaseUserManager):
|
||||
creation_counter: int
|
||||
model: None
|
||||
name: None
|
||||
use_in_migrations: bool = ...
|
||||
def create_user(
|
||||
self,
|
||||
username: str,
|
||||
email: Optional[str] = ...,
|
||||
password: Optional[str] = ...,
|
||||
**extra_fields,
|
||||
) -> User: ...
|
||||
**extra_fields: Any
|
||||
) -> AbstractUser: ...
|
||||
def create_superuser(
|
||||
self,
|
||||
username: str,
|
||||
email: Optional[str],
|
||||
password: Optional[str],
|
||||
**extra_fields: Any
|
||||
) -> AbstractBaseUser: ...
|
||||
|
||||
class PermissionsMixin(models.Model):
|
||||
is_superuser: Any = ...
|
||||
groups: Any = ...
|
||||
user_permissions: Any = ...
|
||||
class Meta:
|
||||
abstract: bool = ...
|
||||
def get_group_permissions(self, obj: None = ...) -> Set[str]: ...
|
||||
def get_all_permissions(self, obj: Optional[str] = ...) -> Set[str]: ...
|
||||
def has_perm(
|
||||
self, perm: Union[str, Tuple[str, Any]], obj: Optional[str] = ...
|
||||
) -> bool: ...
|
||||
def has_perms(
|
||||
self, perm_list: Union[Set[str], List[str], Tuple[str]], obj: None = ...
|
||||
) -> bool: ...
|
||||
def has_module_perms(self, app_label: str) -> bool: ...
|
||||
|
||||
class AbstractUser(AbstractBaseUser, PermissionsMixin):
|
||||
is_superuser: bool
|
||||
last_login: None
|
||||
password: str
|
||||
username_validator: Any = ...
|
||||
username: str = ...
|
||||
first_name: str = ...
|
||||
last_name: str = ...
|
||||
email: str = ...
|
||||
is_staff: bool = ...
|
||||
is_active: bool = ...
|
||||
date_joined: datetime.datetime = ...
|
||||
objects: Any = ...
|
||||
EMAIL_FIELD: str = ...
|
||||
USERNAME_FIELD: str = ...
|
||||
REQUIRED_FIELDS: Any = ...
|
||||
class Meta:
|
||||
verbose_name: Any = ...
|
||||
verbose_name_plural: Any = ...
|
||||
abstract: bool = ...
|
||||
def clean(self) -> None: ...
|
||||
def get_full_name(self) -> str: ...
|
||||
def get_short_name(self) -> str: ...
|
||||
def email_user(
|
||||
self, subject: str, message: str, from_email: str = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
class User(AbstractUser):
|
||||
date_joined: datetime.datetime
|
||||
email: str
|
||||
first_name: str
|
||||
id: None
|
||||
is_active: bool
|
||||
is_staff: bool
|
||||
is_superuser: bool
|
||||
last_login: None
|
||||
last_name: str
|
||||
password: str
|
||||
username: str
|
||||
class Meta(AbstractUser.Meta):
|
||||
swappable: str = ...
|
||||
|
||||
class AnonymousUser:
|
||||
id: Any = ...
|
||||
pk: Any = ...
|
||||
username: str = ...
|
||||
is_staff: bool = ...
|
||||
is_active: bool = ...
|
||||
is_superuser: bool = ...
|
||||
def __eq__(self, other: Union[AnonymousUser, User]) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def save(self) -> Any: ...
|
||||
def delete(self) -> Any: ...
|
||||
def set_password(self, raw_password: str) -> Any: ...
|
||||
def check_password(self, raw_password: str) -> Any: ...
|
||||
@property
|
||||
def groups(self) -> EmptyManager: ...
|
||||
@property
|
||||
def user_permissions(self) -> EmptyManager: ...
|
||||
def get_group_permissions(self, obj: None = ...) -> Set[Any]: ...
|
||||
def get_all_permissions(self, obj: Any = ...) -> Set[str]: ...
|
||||
def has_perm(self, perm: str, obj: None = ...) -> bool: ...
|
||||
def has_perms(
|
||||
self, perm_list: Union[List[str], Tuple[str]], obj: None = ...
|
||||
) -> bool: ...
|
||||
def has_module_perms(self, module: str) -> bool: ...
|
||||
@property
|
||||
def is_anonymous(self) -> bool: ...
|
||||
@property
|
||||
def is_authenticated(self) -> bool: ...
|
||||
def get_username(self) -> str: ...
|
||||
|
||||
@@ -1,54 +1,68 @@
|
||||
# Stubs for django.contrib.auth.password_validation (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
from pathlib import PosixPath
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.contrib.auth.models import User
|
||||
from pathlib import PosixPath
|
||||
from typing import Dict, List, Optional, Tuple, Union
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
|
||||
|
||||
def get_default_password_validators() -> Union[
|
||||
List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]
|
||||
List[Union[CommonPasswordValidator, MinimumLengthValidator]],
|
||||
List[Union[UserAttributeSimilarityValidator, MinimumLengthValidator]],
|
||||
List[NumericPasswordValidator],
|
||||
]: ...
|
||||
def get_password_validators(
|
||||
validator_config: List[Dict[str, str]]
|
||||
) -> Union[List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]]: ...
|
||||
validator_config: List[Dict[str, Union[str, Dict[str, int]]]]
|
||||
) -> Union[
|
||||
List[Union[CommonPasswordValidator, MinimumLengthValidator]],
|
||||
List[Union[UserAttributeSimilarityValidator, MinimumLengthValidator]],
|
||||
List[NumericPasswordValidator],
|
||||
]: ...
|
||||
def validate_password(
|
||||
password: str, user: Optional[User] = ..., password_validators: None = ...
|
||||
password: str,
|
||||
user: Optional[Union[AbstractBaseUser, SimpleLazyObject]] = ...,
|
||||
password_validators: Optional[List[Any]] = ...,
|
||||
) -> None: ...
|
||||
def password_changed(
|
||||
password: str, user: AbstractBaseUser = ..., password_validators: None = ...
|
||||
password: str,
|
||||
user: Optional[AbstractBaseUser] = ...,
|
||||
password_validators: None = ...,
|
||||
) -> None: ...
|
||||
def password_validators_help_texts(password_validators: None = ...) -> List[str]: ...
|
||||
def _password_validators_help_text_html(password_validators: None = ...) -> str: ...
|
||||
def password_validators_help_texts(
|
||||
password_validators: Optional[List[Any]] = ...
|
||||
) -> List[str]: ...
|
||||
|
||||
password_validators_help_text_html: Any
|
||||
|
||||
class MinimumLengthValidator:
|
||||
min_length: Any = ...
|
||||
min_length: int = ...
|
||||
def __init__(self, min_length: int = ...) -> None: ...
|
||||
def validate(self, password: str, user: None = ...) -> None: ...
|
||||
def validate(self, password: str, user: Optional[User] = ...) -> None: ...
|
||||
def get_help_text(self) -> str: ...
|
||||
|
||||
class UserAttributeSimilarityValidator:
|
||||
DEFAULT_USER_ATTRIBUTES: Any = ...
|
||||
user_attributes: Any = ...
|
||||
max_similarity: Any = ...
|
||||
user_attributes: Tuple[str, str, str, str] = ...
|
||||
max_similarity: float = ...
|
||||
def __init__(
|
||||
self, user_attributes: Tuple[str, str, str, str] = ..., max_similarity: float = ...
|
||||
self,
|
||||
user_attributes: Union[Tuple[str, str, str, str], List[str]] = ...,
|
||||
max_similarity: float = ...,
|
||||
) -> None: ...
|
||||
def validate(self, password: str, user: None = ...) -> None: ...
|
||||
def validate(self, password: str, user: Optional[User] = ...) -> None: ...
|
||||
def get_help_text(self) -> str: ...
|
||||
|
||||
class CommonPasswordValidator:
|
||||
DEFAULT_PASSWORD_LIST_PATH: Any = ...
|
||||
passwords: Any = ...
|
||||
def __init__(self, password_list_path: PosixPath = ...) -> None: ...
|
||||
passwords: Set[str] = ...
|
||||
def __init__(
|
||||
self, password_list_path: Union[str, PosixPath] = ...
|
||||
) -> None: ...
|
||||
def validate(self, password: str, user: None = ...) -> None: ...
|
||||
def get_help_text(self): ...
|
||||
def get_help_text(self) -> str: ...
|
||||
|
||||
class NumericPasswordValidator:
|
||||
def validate(self, password: str, user: User = ...) -> None: ...
|
||||
def get_help_text(self): ...
|
||||
def validate(
|
||||
self, password: str, user: Optional[AbstractBaseUser] = ...
|
||||
) -> None: ...
|
||||
def get_help_text(self) -> str: ...
|
||||
|
||||
@@ -1,21 +1,14 @@
|
||||
# Stubs for django.contrib.auth.tokens (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
|
||||
from datetime import date
|
||||
from django.contrib.auth.models import User
|
||||
from typing import Optional
|
||||
|
||||
class PasswordResetTokenGenerator:
|
||||
key_salt: str = ...
|
||||
secret: Any = ...
|
||||
def make_token(self, user: User) -> str: ...
|
||||
def check_token(self, user: User, token: Optional[str]) -> bool: ...
|
||||
def _make_token_with_timestamp(self, user: User, timestamp: int) -> str: ...
|
||||
def _make_hash_value(self, user: User, timestamp: int) -> str: ...
|
||||
def _num_days(self, dt: date) -> int: ...
|
||||
def _today(self) -> date: ...
|
||||
def make_token(self, user: AbstractBaseUser) -> str: ...
|
||||
def check_token(
|
||||
self, user: Optional[AbstractBaseUser], token: Optional[str]
|
||||
) -> bool: ...
|
||||
|
||||
default_token_generator: Any
|
||||
|
||||
@@ -1,64 +1,142 @@
|
||||
from django.contrib.auth.forms import (
|
||||
AuthenticationForm,
|
||||
PasswordChangeForm,
|
||||
PasswordResetForm,
|
||||
SetPasswordForm,
|
||||
)
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from typing import Any, Dict, Optional, Set, Type, Union
|
||||
|
||||
def redirect_to_login(
|
||||
next: str, login_url: Optional[str] = ..., redirect_field_name: Optional[str] = ...
|
||||
) -> HttpResponseRedirect: ...
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.contrib.auth.forms import (AuthenticationForm, PasswordChangeForm,
|
||||
PasswordResetForm, SetPasswordForm)
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.sites.models import Site
|
||||
from django.contrib.sites.requests import RequestSite
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
from django.views.generic.base import TemplateView
|
||||
from django.views.generic.edit import FormView
|
||||
|
||||
class LoginView:
|
||||
UserModel: Any
|
||||
|
||||
class SuccessURLAllowedHostsMixin:
|
||||
success_url_allowed_hosts: Any = ...
|
||||
def get_success_url_allowed_hosts(self) -> Set[str]: ...
|
||||
|
||||
class LoginView(SuccessURLAllowedHostsMixin, FormView):
|
||||
form_class: Any = ...
|
||||
authentication_form: Any = ...
|
||||
redirect_field_name: Any = ...
|
||||
template_name: str = ...
|
||||
redirect_authenticated_user: bool = ...
|
||||
extra_context: Any = ...
|
||||
def dispatch(
|
||||
self, request: HttpRequest, *args, **kwargs
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
||||
def get_context_data(self, **kwargs) -> Dict[str, Any]: ...
|
||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
def get_redirect_url(self) -> str: ...
|
||||
def get_form_class(self) -> Type[AuthenticationForm]: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[str, Optional[Union[MultiValueDict, WSGIRequest]]]: ...
|
||||
def get_redirect_url(self) -> str: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
) -> Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[Dict[Any, Any], Dict[str, str], MultiValueDict, HttpRequest]
|
||||
],
|
||||
]: ...
|
||||
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
||||
def get_context_data(
|
||||
self, **kwargs: Any
|
||||
) -> Dict[
|
||||
str, Union[AuthenticationForm, LoginView, str, Site, RequestSite]
|
||||
]: ...
|
||||
|
||||
class LogoutView:
|
||||
class LogoutView(SuccessURLAllowedHostsMixin, TemplateView):
|
||||
next_page: Any = ...
|
||||
redirect_field_name: Any = ...
|
||||
template_name: str = ...
|
||||
extra_context: Any = ...
|
||||
def dispatch(
|
||||
self, request: HttpRequest, *args, **kwargs
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
def post(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> TemplateResponse: ...
|
||||
def get_next_page(self) -> Optional[str]: ...
|
||||
def post(self, request: WSGIRequest, *args, **kwargs) -> TemplateResponse: ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class PasswordChangeDoneView:
|
||||
def dispatch(self, *args, **kwargs) -> TemplateResponse: ...
|
||||
def logout_then_login(
|
||||
request: HttpRequest, login_url: Optional[str] = ...
|
||||
) -> HttpResponseRedirect: ...
|
||||
def redirect_to_login(
|
||||
next: str,
|
||||
login_url: Optional[str] = ...,
|
||||
redirect_field_name: Optional[str] = ...,
|
||||
) -> HttpResponseRedirect: ...
|
||||
|
||||
class PasswordChangeView:
|
||||
def dispatch(
|
||||
self, *args, **kwargs
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
def form_valid(self, form: PasswordChangeForm) -> HttpResponseRedirect: ...
|
||||
def get_form_kwargs(self) -> Dict[str, Optional[Union[MultiValueDict, User]]]: ...
|
||||
class PasswordContextMixin:
|
||||
extra_context: Any = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class PasswordResetConfirmView:
|
||||
def dispatch(
|
||||
self, *args, **kwargs
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
|
||||
def get_form_kwargs(self) -> Dict[str, Optional[Union[MultiValueDict, User]]]: ...
|
||||
def get_user(self, uidb64: str) -> Optional[User]: ...
|
||||
|
||||
class PasswordResetView:
|
||||
def dispatch(
|
||||
self, *args, **kwargs
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
class PasswordResetView(PasswordContextMixin, FormView):
|
||||
email_template_name: str = ...
|
||||
extra_email_context: Any = ...
|
||||
form_class: Any = ...
|
||||
from_email: Any = ...
|
||||
html_email_template_name: Any = ...
|
||||
subject_template_name: str = ...
|
||||
success_url: Any = ...
|
||||
template_name: str = ...
|
||||
title: Any = ...
|
||||
token_generator: Any = ...
|
||||
def dispatch(self, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||
def form_valid(self, form: PasswordResetForm) -> HttpResponseRedirect: ...
|
||||
|
||||
class SuccessURLAllowedHostsMixin:
|
||||
def get_success_url_allowed_hosts(self) -> Set[str]: ...
|
||||
INTERNAL_RESET_URL_TOKEN: str
|
||||
INTERNAL_RESET_SESSION_TOKEN: str
|
||||
|
||||
class PasswordResetDoneView(PasswordContextMixin, TemplateView):
|
||||
template_name: str = ...
|
||||
title: Any = ...
|
||||
|
||||
class PasswordResetConfirmView(PasswordContextMixin, FormView):
|
||||
form_class: Any = ...
|
||||
post_reset_login: bool = ...
|
||||
post_reset_login_backend: Any = ...
|
||||
success_url: Any = ...
|
||||
template_name: str = ...
|
||||
title: Any = ...
|
||||
token_generator: Any = ...
|
||||
validlink: bool = ...
|
||||
user: Any = ...
|
||||
def dispatch(self, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||
def get_user(self, uidb64: str) -> Optional[AbstractBaseUser]: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[
|
||||
str, Optional[Union[Dict[Any, Any], MultiValueDict, AbstractBaseUser]]
|
||||
]: ...
|
||||
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class PasswordResetCompleteView(PasswordContextMixin, TemplateView):
|
||||
template_name: str = ...
|
||||
title: Any = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class PasswordChangeView(PasswordContextMixin, FormView):
|
||||
form_class: Any = ...
|
||||
success_url: Any = ...
|
||||
template_name: str = ...
|
||||
title: Any = ...
|
||||
def dispatch(self, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[
|
||||
str,
|
||||
Optional[Union[Dict[Any, Any], User, MultiValueDict, SimpleLazyObject]],
|
||||
]: ...
|
||||
def form_valid(self, form: PasswordChangeForm) -> HttpResponseRedirect: ...
|
||||
|
||||
class PasswordChangeDoneView(PasswordContextMixin, TemplateView):
|
||||
template_name: str = ...
|
||||
title: Any = ...
|
||||
def dispatch(self, *args: Any, **kwargs: Any) -> TemplateResponse: ...
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
# Stubs for django.contrib.contenttypes.apps (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Optional
|
||||
|
||||
from .management import create_contenttypes, inject_rename_contenttypes_operations
|
||||
from django.apps import AppConfig
|
||||
from typing import Any
|
||||
|
||||
from .management import (create_contenttypes,
|
||||
inject_rename_contenttypes_operations)
|
||||
|
||||
|
||||
class ContentTypesConfig(AppConfig):
|
||||
apps: None
|
||||
label: str
|
||||
models: None
|
||||
models_module: None
|
||||
module: Any
|
||||
path: str
|
||||
name: str = ...
|
||||
verbose_name: Any = ...
|
||||
def ready(self) -> None: ...
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
# Stubs for django.contrib.contenttypes.checks (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, List
|
||||
|
||||
def check_generic_foreign_keys(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
def check_model_name_lengths(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
def check_generic_foreign_keys(
|
||||
app_configs: None = ..., **kwargs: Any
|
||||
) -> List[Any]: ...
|
||||
def check_model_name_lengths(
|
||||
app_configs: None = ..., **kwargs: Any
|
||||
) -> List[Any]: ...
|
||||
|
||||
@@ -1,27 +1,50 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.checks.messages import Error
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import AutoField, PositiveIntegerField
|
||||
from django.db.models.fields.related import OneToOneField
|
||||
from django.db.models.fields import Field, PositiveIntegerField
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.related import (ForeignObject, ForeignObjectRel,
|
||||
ReverseManyToOneDescriptor)
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import FilteredRelation, PathInfo
|
||||
from django.db.models.sql.where import WhereNode
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
class GenericForeignKey:
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Optional[Union[Model, GenericForeignKey]]: ...
|
||||
|
||||
class GenericForeignKey(FieldCacheMixin):
|
||||
auto_created: bool = ...
|
||||
concrete: bool = ...
|
||||
editable: bool = ...
|
||||
hidden: bool = ...
|
||||
is_relation: bool = ...
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
related_model: Any = ...
|
||||
remote_field: Any = ...
|
||||
ct_field: str = ...
|
||||
fk_field: str = ...
|
||||
for_concrete_model: bool = ...
|
||||
rel: None = ...
|
||||
column: None = ...
|
||||
def __init__(
|
||||
self, ct_field: str = ..., fk_field: str = ..., for_concrete_model: bool = ...
|
||||
self,
|
||||
ct_field: str = ...,
|
||||
fk_field: str = ...,
|
||||
for_concrete_model: bool = ...,
|
||||
) -> None: ...
|
||||
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
def _check_content_type_field(self) -> List[Error]: ...
|
||||
def _check_field_name(self) -> List[Any]: ...
|
||||
def _check_object_id_field(self) -> List[Any]: ...
|
||||
def check(self, **kwargs) -> List[Error]: ...
|
||||
def contribute_to_class(self, cls: Type[Model], name: str, **kwargs) -> None: ...
|
||||
name: Any = ...
|
||||
model: Any = ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> None: ...
|
||||
def get_filter_kwargs_for_object(
|
||||
self, obj: Model
|
||||
) -> Dict[str, Optional[Union[int, ContentType]]]: ...
|
||||
def get_forward_related_filter(self, obj: Model) -> Dict[str, int]: ...
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
def get_cache_name(self) -> str: ...
|
||||
def get_content_type(
|
||||
self,
|
||||
@@ -29,15 +52,26 @@ class GenericForeignKey:
|
||||
id: Optional[int] = ...,
|
||||
using: Optional[str] = ...,
|
||||
) -> ContentType: ...
|
||||
def get_filter_kwargs_for_object(
|
||||
self, obj: Model
|
||||
) -> Dict[str, Optional[Union[ContentType, int]]]: ...
|
||||
def get_forward_related_filter(self, obj: Model) -> Dict[str, int]: ...
|
||||
def get_prefetch_queryset(
|
||||
self, instances: Union[List[Model], QuerySet], queryset: Optional[QuerySet] = ...
|
||||
self,
|
||||
instances: Union[QuerySet, List[Model]],
|
||||
queryset: Optional[QuerySet] = ...,
|
||||
) -> Tuple[List[Model], Callable, Callable, bool, str, bool]: ...
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Optional[Union[Model, GenericForeignKey]]: ...
|
||||
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
|
||||
|
||||
class GenericRel:
|
||||
class GenericRel(ForeignObjectRel):
|
||||
field: django.contrib.contenttypes.fields.GenericRelation
|
||||
limit_choices_to: Dict[Any, Any]
|
||||
model: Type[django.db.models.base.Model]
|
||||
multiple: bool
|
||||
on_delete: Callable
|
||||
parent_link: bool
|
||||
related_name: str
|
||||
related_query_name: None
|
||||
symmetrical: bool
|
||||
def __init__(
|
||||
self,
|
||||
field: GenericRelation,
|
||||
@@ -47,7 +81,17 @@ class GenericRel:
|
||||
limit_choices_to: None = ...,
|
||||
) -> None: ...
|
||||
|
||||
class GenericRelation:
|
||||
class GenericRelation(ForeignObject):
|
||||
auto_created: bool = ...
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
rel_class: Any = ...
|
||||
mti_inherited: bool = ...
|
||||
object_id_field_name: Any = ...
|
||||
content_type_field_name: Any = ...
|
||||
for_concrete_model: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
to: Union[Type[Model], str],
|
||||
@@ -56,29 +100,40 @@ class GenericRelation:
|
||||
for_concrete_model: bool = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: None = ...,
|
||||
**kwargs,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def _check_generic_foreign_key_existence(self) -> List[Any]: ...
|
||||
def _get_path_info_with_parent(self, filtered_relation: None) -> List[PathInfo]: ...
|
||||
def _is_matching_generic_foreign_key(
|
||||
self, field: Optional[Union[GenericForeignKey, GenericRelation]]
|
||||
) -> bool: ...
|
||||
def bulk_related_objects(self, objs: List[Model], using: str = ...) -> QuerySet: ...
|
||||
def check(self, **kwargs) -> List[Error]: ...
|
||||
def contribute_to_class(self, cls: Type[Model], name: str, **kwargs) -> None: ...
|
||||
def get_content_type(self) -> ContentType: ...
|
||||
def get_extra_restriction(
|
||||
self, where_class: Type[WhereNode], alias: Optional[str], remote_alias: str
|
||||
) -> WhereNode: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
to_fields: Any = ...
|
||||
def resolve_related_fields(
|
||||
self
|
||||
) -> List[Tuple[PositiveIntegerField, Field]]: ...
|
||||
def get_path_info(
|
||||
self, filtered_relation: Optional[FilteredRelation] = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def get_reverse_path_info(self, filtered_relation: None = ...) -> List[PathInfo]: ...
|
||||
def resolve_related_fields(
|
||||
self
|
||||
) -> Union[
|
||||
List[Tuple[PositiveIntegerField, related.OneToOneField]],
|
||||
List[Tuple[PositiveIntegerField, AutoField]],
|
||||
]: ...
|
||||
def get_reverse_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
model: Any = ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> None: ...
|
||||
def set_attributes_from_rel(self) -> None: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def get_content_type(self) -> ContentType: ...
|
||||
def get_extra_restriction(
|
||||
self,
|
||||
where_class: Type[WhereNode],
|
||||
alias: Optional[str],
|
||||
remote_alias: str,
|
||||
) -> WhereNode: ...
|
||||
def bulk_related_objects(
|
||||
self, objs: List[Model], using: str = ...
|
||||
) -> QuerySet: ...
|
||||
|
||||
class ReverseGenericManyToOneDescriptor(ReverseManyToOneDescriptor):
|
||||
field: django.contrib.contenttypes.fields.GenericRelation
|
||||
rel: django.contrib.contenttypes.fields.GenericRel
|
||||
def related_manager_cls(self): ...
|
||||
|
||||
def create_generic_related_manager(superclass: Any, rel: Any): ...
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.forms.models import BaseModelFormSet
|
||||
|
||||
|
||||
class BaseGenericInlineFormSet(BaseModelFormSet):
|
||||
instance: Any = ...
|
||||
rel_name: Any = ...
|
||||
save_as_new: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
data: Optional[Any] = ...,
|
||||
files: Optional[Any] = ...,
|
||||
instance: Optional[Any] = ...,
|
||||
save_as_new: bool = ...,
|
||||
prefix: Optional[Any] = ...,
|
||||
queryset: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def initial_form_count(self): ...
|
||||
@classmethod
|
||||
def get_default_prefix(cls): ...
|
||||
def save_new(self, form: Any, commit: bool = ...): ...
|
||||
|
||||
def generic_inlineformset_factory(
|
||||
model: Any,
|
||||
form: Any = ...,
|
||||
formset: Any = ...,
|
||||
ct_field: str = ...,
|
||||
fk_field: str = ...,
|
||||
fields: Optional[Any] = ...,
|
||||
exclude: Optional[Any] = ...,
|
||||
extra: int = ...,
|
||||
can_order: bool = ...,
|
||||
can_delete: bool = ...,
|
||||
max_num: Optional[Any] = ...,
|
||||
formfield_callback: Optional[Any] = ...,
|
||||
validate_max: bool = ...,
|
||||
for_concrete_model: bool = ...,
|
||||
min_num: Optional[Any] = ...,
|
||||
validate_min: bool = ...,
|
||||
): ...
|
||||
|
||||
@@ -1,29 +1,20 @@
|
||||
# Stubs for django.contrib.contenttypes.management (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.db import migrations
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Dict, List, Optional, Tuple, Type
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
from django.apps.registry import Apps
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import migrations
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.migrations.migration import Migration
|
||||
from django.db.migrations.state import StateApps
|
||||
from typing import Any, List, Tuple, Type, Union
|
||||
|
||||
|
||||
class RenameContentType(migrations.RunPython):
|
||||
app_label: Any = ...
|
||||
old_model: Any = ...
|
||||
new_model: Any = ...
|
||||
def __init__(self, app_label: str, old_model: str, new_model: str) -> None: ...
|
||||
def _rename(
|
||||
self,
|
||||
apps: StateApps,
|
||||
schema_editor: DatabaseSchemaEditor,
|
||||
old_model: str,
|
||||
new_model: str,
|
||||
def __init__(
|
||||
self, app_label: str, old_model: str, new_model: str
|
||||
) -> None: ...
|
||||
def rename_forward(
|
||||
self, apps: StateApps, schema_editor: DatabaseSchemaEditor
|
||||
@@ -33,19 +24,19 @@ class RenameContentType(migrations.RunPython):
|
||||
) -> None: ...
|
||||
|
||||
def inject_rename_contenttypes_operations(
|
||||
plan: Union[List[Any], List[Tuple[Migration, bool]]] = ...,
|
||||
plan: List[Tuple[Migration, bool]] = ...,
|
||||
apps: StateApps = ...,
|
||||
using: str = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def get_contenttypes_and_models(
|
||||
app_config: AppConfig, using: str, ContentType: Type[ContentType]
|
||||
) -> Any: ...
|
||||
) -> Tuple[Dict[str, ContentType], Dict]: ...
|
||||
def create_contenttypes(
|
||||
app_config: AppConfig,
|
||||
verbosity: int = ...,
|
||||
interactive: bool = ...,
|
||||
using: str = ...,
|
||||
apps: Apps = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,8 +1,23 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.management import BaseCommand
|
||||
from django.core.management.base import CommandParser
|
||||
from django.db.models.deletion import Collector
|
||||
|
||||
class Command:
|
||||
from ...management import get_contenttypes_and_models
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
stderr: django.core.management.base.OutputWrapper
|
||||
stdout: django.core.management.base.OutputWrapper
|
||||
style: django.core.management.color.Style
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, **options) -> None: ...
|
||||
def handle(self, **options: Any) -> None: ...
|
||||
|
||||
class NoFastDeleteCollector:
|
||||
def can_fast_delete(self, *args, **kwargs) -> bool: ...
|
||||
class NoFastDeleteCollector(Collector):
|
||||
data: collections.OrderedDict
|
||||
dependencies: Dict[Any, Any]
|
||||
fast_deletes: List[Any]
|
||||
field_updates: Dict[Any, Any]
|
||||
using: str
|
||||
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ...
|
||||
|
||||
@@ -1,26 +1,36 @@
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.options import Options
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import Any, Dict, Tuple, Type
|
||||
from typing import Any, Optional, Type, Union
|
||||
|
||||
class ContentType:
|
||||
def __str__(self) -> str: ...
|
||||
def get_all_objects_for_this_type(self, **kwargs) -> QuerySet: ...
|
||||
def get_object_for_this_type(self, **kwargs) -> Model: ...
|
||||
def model_class(self) -> Any: ...
|
||||
from django.db import models
|
||||
from django.db.models.base import Model
|
||||
|
||||
|
||||
class ContentTypeManager(models.Manager):
|
||||
creation_counter: int
|
||||
model: None
|
||||
name: None
|
||||
use_in_migrations: bool = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def get_by_natural_key(self, app_label: Any, model: Any): ...
|
||||
def get_for_model(
|
||||
self, model: Union[Type[Model], Model], for_concrete_model: bool = ...
|
||||
) -> ContentType: ...
|
||||
def get_for_models(self, *models: Any, for_concrete_models: bool = ...): ...
|
||||
def get_for_id(self, id: int) -> ContentType: ...
|
||||
def clear_cache(self) -> None: ...
|
||||
|
||||
class ContentType(models.Model):
|
||||
id: int
|
||||
app_label: str = ...
|
||||
model: str = ...
|
||||
objects: Any = ...
|
||||
class Meta:
|
||||
verbose_name: Any = ...
|
||||
verbose_name_plural: Any = ...
|
||||
db_table: str = ...
|
||||
unique_together: Any = ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
def natural_key(self) -> Tuple[str, str]: ...
|
||||
|
||||
class ContentTypeManager:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def _add_to_cache(self, using: str, ct: ContentType) -> None: ...
|
||||
def _get_from_cache(self, opts: Options) -> ContentType: ...
|
||||
def _get_opts(self, model: Any, for_concrete_model: bool) -> Options: ...
|
||||
def clear_cache(self) -> None: ...
|
||||
def get_by_natural_key(self, app_label: str, model: str) -> ContentType: ...
|
||||
def get_for_id(self, id: int) -> ContentType: ...
|
||||
def get_for_model(self, model: Any, for_concrete_model: bool = ...) -> ContentType: ...
|
||||
def get_for_models(
|
||||
self, *models, for_concrete_models=...
|
||||
) -> Dict[Type[Model], ContentType]: ...
|
||||
def model_class(self) -> Type[Model]: ...
|
||||
def get_object_for_this_type(self, **kwargs: Any) -> Model: ...
|
||||
def get_all_objects_for_this_type(self, **kwargs: Any): ...
|
||||
def natural_key(self): ...
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseRedirect
|
||||
from typing import Union
|
||||
|
||||
|
||||
def shortcut(
|
||||
request: HttpRequest, content_type_id: Union[str, int], object_id: Union[str, int]
|
||||
request: HttpRequest,
|
||||
content_type_id: Union[str, int],
|
||||
object_id: Union[str, int],
|
||||
) -> HttpResponseRedirect: ...
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from django import forms
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
|
||||
class FlatpageForm(forms.ModelForm):
|
||||
auto_id: str
|
||||
data: Dict[str, Union[str, List[int]]]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[str, Union[int, str, List[django.contrib.sites.models.Site]]]
|
||||
instance: django.contrib.flatpages.models.FlatPage
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
url: Any = ...
|
||||
class Meta:
|
||||
model: Any = ...
|
||||
fields: str = ...
|
||||
def clean_url(self) -> str: ...
|
||||
def clean(self) -> Dict[str, Union[str, bool, QuerySet]]: ...
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
|
||||
class FlatpageFallbackMiddleware(MiddlewareMixin):
|
||||
get_response: Callable
|
||||
def process_response(
|
||||
self, request: WSGIRequest, response: HttpResponse
|
||||
) -> HttpResponse: ...
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
||||
class FlatPage(models.Model):
|
||||
id: None
|
||||
url: str = ...
|
||||
title: str = ...
|
||||
content: str = ...
|
||||
enable_comments: bool = ...
|
||||
template_name: str = ...
|
||||
registration_required: bool = ...
|
||||
sites: Any = ...
|
||||
class Meta:
|
||||
db_table: str = ...
|
||||
verbose_name: Any = ...
|
||||
verbose_name_plural: Any = ...
|
||||
ordering: Any = ...
|
||||
def get_absolute_url(self) -> str: ...
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Stubs for django.contrib.flatpages.sitemaps (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Optional
|
||||
|
||||
from django.contrib.sitemaps import Sitemap
|
||||
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
|
||||
class FlatPageSitemap(Sitemap):
|
||||
def items(self) -> QuerySet: ...
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django import template
|
||||
from django.template.base import Parser, Token
|
||||
from django.template.context import Context
|
||||
|
||||
register: Any
|
||||
|
||||
class FlatpageNode(template.Node):
|
||||
context_name: str = ...
|
||||
starts_with: None = ...
|
||||
user: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
context_name: str,
|
||||
starts_with: Optional[str] = ...,
|
||||
user: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
def get_flatpages(parser: Parser, token: Token) -> FlatpageNode: ...
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.flatpages.models import FlatPage
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
|
||||
DEFAULT_TEMPLATE: str
|
||||
|
||||
def flatpage(request: WSGIRequest, url: str) -> HttpResponse: ...
|
||||
def render_flatpage(request: WSGIRequest, f: FlatPage) -> HttpResponse: ...
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
# Stubs for django.contrib.humanize.templatetags.humanize (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from datetime import date, datetime
|
||||
from typing import Optional, Union
|
||||
from decimal import Decimal
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
register: Any
|
||||
|
||||
def ordinal(value: Optional[str]) -> Optional[str]: ...
|
||||
def intcomma(value: Optional[Union[str, float]], use_l10n: bool = ...) -> str: ...
|
||||
def intcomma(
|
||||
value: Optional[Union[Decimal, float, str]], use_l10n: bool = ...
|
||||
) -> str: ...
|
||||
|
||||
intword_converters: Any
|
||||
|
||||
def intword(value: Optional[str]) -> Optional[str]: ...
|
||||
def apnumber(value: str) -> str: ...
|
||||
def naturalday(value: Optional[date], arg: None = ...) -> Optional[str]: ...
|
||||
def intword(value: Optional[str]) -> Optional[Union[str, int]]: ...
|
||||
def apnumber(value: Optional[str]) -> Optional[Union[str, int]]: ...
|
||||
def naturalday(
|
||||
value: Optional[Union[date, str]], arg: None = ...
|
||||
) -> Optional[str]: ...
|
||||
def naturaltime(value: datetime) -> str: ...
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
# Stubs for django.contrib.messages.api (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, List, Optional, Union
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Optional, Union
|
||||
|
||||
|
||||
class MessageFailure(Exception): ...
|
||||
|
||||
@@ -16,34 +12,34 @@ def add_message(
|
||||
level: int,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: Union[str, bool] = ...,
|
||||
fail_silently: Union[bool, str] = ...,
|
||||
) -> None: ...
|
||||
def get_messages(request: HttpRequest) -> BaseStorage: ...
|
||||
def get_messages(request: HttpRequest) -> Union[BaseStorage, List[Any]]: ...
|
||||
def get_level(request: HttpRequest) -> int: ...
|
||||
def set_level(request: HttpRequest, level: int) -> bool: ...
|
||||
def debug(
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: Union[str, bool] = ...,
|
||||
fail_silently: Union[bool, str] = ...,
|
||||
) -> None: ...
|
||||
def info(
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: Union[str, bool] = ...,
|
||||
fail_silently: Union[bool, str] = ...,
|
||||
) -> None: ...
|
||||
def success(
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: Union[str, bool] = ...,
|
||||
fail_silently: Union[bool, str] = ...,
|
||||
) -> None: ...
|
||||
def warning(
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: Union[str, bool] = ...,
|
||||
fail_silently: Union[bool, str] = ...,
|
||||
) -> None: ...
|
||||
def error(
|
||||
request: WSGIRequest,
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
# Stubs for django.contrib.messages.context_processors (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from typing import Any
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
from django.contrib.messages.storage.cookie import CookieStorage
|
||||
from django.contrib.messages.storage.fallback import FallbackStorage
|
||||
from django.contrib.messages.storage.session import SessionStorage
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Dict, Union
|
||||
|
||||
def messages(request: HttpRequest) -> Dict[str, Union[Dict[str, int], BaseStorage]]: ...
|
||||
|
||||
def messages(
|
||||
request: HttpRequest
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Any],
|
||||
Dict[str, int],
|
||||
FallbackStorage,
|
||||
SessionStorage,
|
||||
CookieStorage,
|
||||
],
|
||||
]: ...
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
# Stubs for django.contrib.messages.middleware (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseBase
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
|
||||
class MessageMiddleware(MiddlewareMixin):
|
||||
get_response: Callable
|
||||
def process_request(self, request: WSGIRequest) -> None: ...
|
||||
def process_response(
|
||||
self, request: HttpRequest, response: HttpResponseBase
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
# Stubs for django.contrib.messages.storage (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
from django.http.request import HttpRequest
|
||||
|
||||
|
||||
def default_storage(request: HttpRequest) -> BaseStorage: ...
|
||||
|
||||
@@ -1,26 +1,35 @@
|
||||
from typing import Any, List, Optional, Union
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseBase
|
||||
from typing import List, Optional, Union
|
||||
|
||||
class BaseStorage:
|
||||
def __init__(self, request: HttpRequest, *args, **kwargs) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def _get_level(self) -> int: ...
|
||||
@property
|
||||
def _loaded_messages(self) -> Union[List[Message], List[str]]: ...
|
||||
def _prepare_messages(self, messages: List[Message]) -> None: ...
|
||||
def _set_level(self, value: int = ...) -> None: ...
|
||||
def add(self, level: int, message: str, extra_tags: Optional[str] = ...) -> None: ...
|
||||
def update(self, response: HttpResponseBase) -> None: ...
|
||||
LEVEL_TAGS: Any
|
||||
|
||||
class Message:
|
||||
def __eq__(self, other: Union[str, Message]) -> bool: ...
|
||||
level: int = ...
|
||||
message: str = ...
|
||||
extra_tags: str = ...
|
||||
def __init__(
|
||||
self, level: int, message: str, extra_tags: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
def _prepare(self) -> None: ...
|
||||
@property
|
||||
def level_tag(self) -> str: ...
|
||||
def __eq__(self, other: Union[str, Message]) -> bool: ...
|
||||
@property
|
||||
def tags(self) -> str: ...
|
||||
@property
|
||||
def level_tag(self) -> str: ...
|
||||
|
||||
class BaseStorage:
|
||||
request: Any = ...
|
||||
used: bool = ...
|
||||
added_new: bool = ...
|
||||
def __init__(
|
||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self): ...
|
||||
def __contains__(self, item: Any): ...
|
||||
def update(self, response: HttpResponseBase) -> Optional[List[Message]]: ...
|
||||
def add(
|
||||
self, level: int, message: str, extra_tags: Optional[str] = ...
|
||||
) -> None: ...
|
||||
level: Any = ...
|
||||
|
||||
@@ -1,51 +1,43 @@
|
||||
# Stubs for django.contrib.messages.storage.cookie (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
import json
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
from typing import Any
|
||||
from typing import Any, Collection, Dict, List, Optional, Union
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage, Message
|
||||
|
||||
from django.contrib.messages.storage.base import Message
|
||||
from django.http.response import HttpResponse
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
|
||||
class MessageEncoder(json.JSONEncoder):
|
||||
allow_nan: bool
|
||||
check_circular: bool
|
||||
ensure_ascii: bool
|
||||
indent: None
|
||||
item_separator: str
|
||||
key_separator: str
|
||||
skipkeys: bool
|
||||
sort_keys: bool
|
||||
message_key: str = ...
|
||||
def default(self, obj: Message) -> List[Union[int, str]]: ...
|
||||
def default(self, obj: Message) -> List[Union[str, int]]: ...
|
||||
|
||||
class MessageDecoder(json.JSONDecoder):
|
||||
def process_messages(self, obj: Any) -> Any: ...
|
||||
def process_messages(self, obj: Collection) -> Any: ...
|
||||
def decode(
|
||||
self, s: str, **kwargs: Any
|
||||
) -> Union[List[Union[Message, str]], List[Message], List[str]]: ...
|
||||
) -> Union[
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[Message, List[Union[Message, Dict[str, Message]]]],
|
||||
],
|
||||
Message,
|
||||
]
|
||||
],
|
||||
Message,
|
||||
List[Union[Message, str]],
|
||||
]: ...
|
||||
|
||||
class CookieStorage(BaseStorage):
|
||||
added_new: bool
|
||||
request: django.core.handlers.wsgi.WSGIRequest
|
||||
used: bool
|
||||
cookie_name: str = ...
|
||||
max_cookie_size: int = ...
|
||||
not_finished: str = ...
|
||||
def _get(
|
||||
self, *args: Any, **kwargs: Any
|
||||
) -> Union[
|
||||
Tuple[None, bool],
|
||||
Tuple[List[Any], bool],
|
||||
Tuple[List[str], bool],
|
||||
Tuple[List[Message], bool],
|
||||
]: ...
|
||||
def _update_cookie(
|
||||
self, encoded_data: Optional[str], response: HttpResponse
|
||||
) -> None: ...
|
||||
def _store(
|
||||
self,
|
||||
messages: List[Message],
|
||||
response: HttpResponse,
|
||||
remove_oldest: bool = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
) -> List[Message]: ...
|
||||
def _hash(self, value: str) -> str: ...
|
||||
def _encode(
|
||||
self, messages: Union[List[Message], List[str]], encode_empty: bool = ...
|
||||
) -> Optional[str]: ...
|
||||
used: bool = ...
|
||||
def _decode(self, data: Optional[str]) -> Any: ...
|
||||
|
||||
@@ -1,24 +1,12 @@
|
||||
# Stubs for django.contrib.messages.storage.fallback (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
from typing import Any
|
||||
|
||||
from django.contrib.messages.storage.base import Message
|
||||
from django.http.response import HttpResponse
|
||||
from typing import Any, List, Tuple, Union
|
||||
|
||||
class FallbackStorage(BaseStorage):
|
||||
added_new: bool
|
||||
request: django.core.handlers.wsgi.WSGIRequest
|
||||
used: bool
|
||||
storage_classes: Any = ...
|
||||
storages: Any = ...
|
||||
_used_storages: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def _get(
|
||||
self, *args: Any, **kwargs: Any
|
||||
) -> Union[
|
||||
Tuple[List[Any], bool], Tuple[List[str], bool], Tuple[List[Message], bool]
|
||||
]: ...
|
||||
def _store(
|
||||
self, messages: List[Message], response: HttpResponse, *args: Any, **kwargs: Any
|
||||
) -> List[Any]: ...
|
||||
|
||||
@@ -1,25 +1,20 @@
|
||||
# Stubs for django.contrib.messages.storage.session (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, List, Optional, Union
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
from typing import Any
|
||||
|
||||
from django.contrib.messages.storage.base import Message
|
||||
from django.contrib.messages.storage.base import BaseStorage, Message
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponse
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
|
||||
|
||||
class SessionStorage(BaseStorage):
|
||||
added_new: bool
|
||||
request: django.core.handlers.wsgi.WSGIRequest
|
||||
used: bool
|
||||
session_key: str = ...
|
||||
def __init__(self, request: HttpRequest, *args: Any, **kwargs: Any) -> None: ...
|
||||
def _get(
|
||||
self, *args: Any, **kwargs: Any
|
||||
) -> Union[Tuple[None, bool], Tuple[List[str], bool], Tuple[List[Message], bool]]: ...
|
||||
def _store(
|
||||
self, messages: List[Message], response: HttpResponse, *args: Any, **kwargs: Any
|
||||
) -> List[Any]: ...
|
||||
def serialize_messages(self, messages: Union[List[Message], List[str]]) -> str: ...
|
||||
def __init__(
|
||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def serialize_messages(
|
||||
self, messages: Union[List[Message], List[str]]
|
||||
) -> str: ...
|
||||
def deserialize_messages(
|
||||
self, data: Optional[str]
|
||||
) -> Optional[Union[List[Message], List[str]]]: ...
|
||||
self, data: Optional[Union[str, List[Any]]]
|
||||
) -> Optional[Union[List[str], List[Message]]]: ...
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
# Stubs for django.contrib.messages.utils (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Dict, Optional
|
||||
|
||||
from typing import Dict
|
||||
|
||||
def get_level_tags() -> Dict[int, str]: ...
|
||||
|
||||
10
django-stubs/contrib/messages/views.pyi
Normal file
10
django-stubs/contrib/messages/views.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from django.forms.forms import Form
|
||||
from django.http.response import HttpResponseRedirect
|
||||
|
||||
|
||||
class SuccessMessageMixin:
|
||||
success_message: str = ...
|
||||
def form_valid(self, form: Form) -> HttpResponseRedirect: ...
|
||||
def get_success_message(self, cleaned_data: Dict[str, str]) -> str: ...
|
||||
89
django-stubs/contrib/postgres/fields/array.pyi
Normal file
89
django-stubs/contrib/postgres/fields/array.pyi
Normal file
@@ -0,0 +1,89 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from django.contrib.postgres import lookups
|
||||
from django.db.models import Field, Transform
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.lookups import Exact, In
|
||||
|
||||
from .mixins import CheckFieldDefaultMixin
|
||||
|
||||
|
||||
class ArrayField(CheckFieldDefaultMixin, Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
base_field: Any = ...
|
||||
size: Any = ...
|
||||
default_validators: Any = ...
|
||||
from_db_value: Any = ...
|
||||
def __init__(
|
||||
self, base_field: Field, size: None = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
@property
|
||||
def model(self): ...
|
||||
@model.setter
|
||||
def model(self, model: Any) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def set_attributes_from_name(self, name: str) -> None: ...
|
||||
@property
|
||||
def description(self): ...
|
||||
def db_type(self, connection: Any): ...
|
||||
def get_db_prep_value(
|
||||
self, value: Any, connection: Any, prepared: bool = ...
|
||||
): ...
|
||||
def deconstruct(self) -> Tuple[None, str, List[Any], Dict[str, Any]]: ...
|
||||
def to_python(self, value: Any): ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
def get_transform(self, name: Any): ...
|
||||
def validate(self, value: Any, model_instance: Any) -> None: ...
|
||||
def run_validators(self, value: Any) -> None: ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
|
||||
class ArrayContains(lookups.DataContains):
|
||||
def as_sql(self, qn: Any, connection: Any): ...
|
||||
|
||||
class ArrayContainedBy(lookups.ContainedBy):
|
||||
def as_sql(self, qn: Any, connection: Any): ...
|
||||
|
||||
class ArrayExact(Exact):
|
||||
def as_sql(self, qn: Any, connection: Any): ...
|
||||
|
||||
class ArrayOverlap(lookups.Overlap):
|
||||
def as_sql(self, qn: Any, connection: Any): ...
|
||||
|
||||
class ArrayLenTransform(Transform):
|
||||
lookup_name: str = ...
|
||||
output_field: Any = ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class ArrayInLookup(In):
|
||||
def get_prep_lookup(self): ...
|
||||
|
||||
class IndexTransform(Transform):
|
||||
index: Any = ...
|
||||
base_field: Any = ...
|
||||
def __init__(
|
||||
self, index: Any, base_field: Any, *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
@property
|
||||
def output_field(self): ...
|
||||
|
||||
class IndexTransformFactory:
|
||||
index: Any = ...
|
||||
base_field: Any = ...
|
||||
def __init__(self, index: Any, base_field: Any) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any): ...
|
||||
|
||||
class SliceTransform(Transform):
|
||||
start: Any = ...
|
||||
end: Any = ...
|
||||
def __init__(
|
||||
self, start: Any, end: Any, *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class SliceTransformFactory:
|
||||
start: Any = ...
|
||||
end: Any = ...
|
||||
def __init__(self, start: Any, end: Any) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any): ...
|
||||
89
django-stubs/contrib/postgres/fields/jsonb.pyi
Normal file
89
django-stubs/contrib/postgres/fields/jsonb.pyi
Normal file
@@ -0,0 +1,89 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from psycopg2.extras import Json
|
||||
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.db.models import Field, Transform
|
||||
from django.db.models import lookups as builtin_lookups
|
||||
|
||||
from .mixins import CheckFieldDefaultMixin
|
||||
|
||||
|
||||
class JsonAdapter(Json):
|
||||
encoder: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
adapted: Any,
|
||||
dumps: Optional[Any] = ...,
|
||||
encoder: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def dumps(self, obj: Any): ...
|
||||
|
||||
class JSONField(CheckFieldDefaultMixin, Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
description: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
encoder: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: None = ...,
|
||||
name: None = ...,
|
||||
encoder: Optional[Type[DjangoJSONEncoder]] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def db_type(self, connection: Any): ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
None, str, List[Any], Dict[str, Union[bool, Type[DjangoJSONEncoder]]]
|
||||
]: ...
|
||||
def get_transform(self, name: Any): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def validate(self, value: Any, model_instance: Any) -> None: ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
|
||||
class KeyTransform(Transform):
|
||||
operator: str = ...
|
||||
nested_operator: str = ...
|
||||
key_name: Any = ...
|
||||
def __init__(self, key_name: Any, *args: Any, **kwargs: Any) -> None: ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class KeyTextTransform(KeyTransform):
|
||||
operator: str = ...
|
||||
nested_operator: str = ...
|
||||
output_field: Any = ...
|
||||
|
||||
class KeyTransformTextLookupMixin:
|
||||
def __init__(
|
||||
self, key_transform: Any, *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
class KeyTransformIExact(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.IExact
|
||||
): ...
|
||||
class KeyTransformIContains(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.IContains
|
||||
): ...
|
||||
class KeyTransformStartsWith(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.StartsWith
|
||||
): ...
|
||||
class KeyTransformIStartsWith(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.IStartsWith
|
||||
): ...
|
||||
class KeyTransformEndsWith(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.EndsWith
|
||||
): ...
|
||||
class KeyTransformIEndsWith(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.IEndsWith
|
||||
): ...
|
||||
class KeyTransformRegex(KeyTransformTextLookupMixin, builtin_lookups.Regex): ...
|
||||
class KeyTransformIRegex(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.IRegex
|
||||
): ...
|
||||
|
||||
class KeyTransformFactory:
|
||||
key_name: Any = ...
|
||||
def __init__(self, key_name: Any) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any): ...
|
||||
5
django-stubs/contrib/postgres/fields/mixins.pyi
Normal file
5
django-stubs/contrib/postgres/fields/mixins.pyi
Normal file
@@ -0,0 +1,5 @@
|
||||
from typing import Any, List, Optional
|
||||
|
||||
|
||||
class CheckFieldDefaultMixin:
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
98
django-stubs/contrib/postgres/fields/ranges.pyi
Normal file
98
django-stubs/contrib/postgres/fields/ranges.pyi
Normal file
@@ -0,0 +1,98 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.postgres import lookups
|
||||
from django.db import models
|
||||
|
||||
|
||||
class RangeField(models.Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
base_field: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
@property
|
||||
def model(self): ...
|
||||
@model.setter
|
||||
def model(self, model: Any) -> None: ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def set_attributes_from_name(self, name: str) -> None: ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
|
||||
class IntegerRangeField(RangeField):
|
||||
base_field: Any = ...
|
||||
range_type: Any = ...
|
||||
form_field: Any = ...
|
||||
def db_type(self, connection: Any): ...
|
||||
|
||||
class BigIntegerRangeField(RangeField):
|
||||
base_field: Any = ...
|
||||
range_type: Any = ...
|
||||
form_field: Any = ...
|
||||
def db_type(self, connection: Any): ...
|
||||
|
||||
class FloatRangeField(RangeField):
|
||||
base_field: Any = ...
|
||||
range_type: Any = ...
|
||||
form_field: Any = ...
|
||||
def db_type(self, connection: Any): ...
|
||||
|
||||
class DateTimeRangeField(RangeField):
|
||||
base_field: Any = ...
|
||||
range_type: Any = ...
|
||||
form_field: Any = ...
|
||||
def db_type(self, connection: Any): ...
|
||||
|
||||
class DateRangeField(RangeField):
|
||||
base_field: Any = ...
|
||||
range_type: Any = ...
|
||||
form_field: Any = ...
|
||||
def db_type(self, connection: Any): ...
|
||||
|
||||
class DateTimeRangeContains(models.Lookup):
|
||||
lookup_name: str = ...
|
||||
rhs: Any = ...
|
||||
def process_rhs(self, compiler: Any, connection: Any): ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class RangeContainedBy(models.Lookup):
|
||||
lookup_name: str = ...
|
||||
type_mapping: Any = ...
|
||||
def as_sql(self, qn: Any, connection: Any): ...
|
||||
def get_prep_lookup(self): ...
|
||||
|
||||
class FullyLessThan(lookups.PostgresSimpleLookup):
|
||||
lookup_name: str = ...
|
||||
operator: str = ...
|
||||
|
||||
class FullGreaterThan(lookups.PostgresSimpleLookup):
|
||||
lookup_name: str = ...
|
||||
operator: str = ...
|
||||
|
||||
class NotLessThan(lookups.PostgresSimpleLookup):
|
||||
lookup_name: str = ...
|
||||
operator: str = ...
|
||||
|
||||
class NotGreaterThan(lookups.PostgresSimpleLookup):
|
||||
lookup_name: str = ...
|
||||
operator: str = ...
|
||||
|
||||
class AdjacentToLookup(lookups.PostgresSimpleLookup):
|
||||
lookup_name: str = ...
|
||||
operator: str = ...
|
||||
|
||||
class RangeStartsWith(models.Transform):
|
||||
lookup_name: str = ...
|
||||
function: str = ...
|
||||
@property
|
||||
def output_field(self): ...
|
||||
|
||||
class RangeEndsWith(models.Transform):
|
||||
lookup_name: str = ...
|
||||
function: str = ...
|
||||
@property
|
||||
def output_field(self): ...
|
||||
|
||||
class IsEmpty(models.Transform):
|
||||
lookup_name: str = ...
|
||||
function: str = ...
|
||||
output_field: Any = ...
|
||||
51
django-stubs/contrib/postgres/operations.pyi
Normal file
51
django-stubs/contrib/postgres/operations.pyi
Normal file
@@ -0,0 +1,51 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.migrations.operations.base import Operation
|
||||
from django.db.migrations.state import ProjectState
|
||||
|
||||
|
||||
class CreateExtension(Operation):
|
||||
reversible: bool = ...
|
||||
name: Any = ...
|
||||
def __init__(self, name: str) -> None: ...
|
||||
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
|
||||
def database_forwards(
|
||||
self,
|
||||
app_label: str,
|
||||
schema_editor: DatabaseSchemaEditor,
|
||||
from_state: ProjectState,
|
||||
to_state: ProjectState,
|
||||
) -> None: ...
|
||||
def database_backwards(
|
||||
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
|
||||
) -> None: ...
|
||||
def describe(self): ...
|
||||
|
||||
class BtreeGinExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class BtreeGistExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class CITextExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class CryptoExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class HStoreExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class TrigramExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class UnaccentExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
@@ -0,0 +1,15 @@
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
|
||||
class RedirectFallbackMiddleware(MiddlewareMixin):
|
||||
get_response: Callable
|
||||
response_gone_class: Any = ...
|
||||
response_redirect_class: Any = ...
|
||||
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
||||
def process_response(
|
||||
self, request: WSGIRequest, response: HttpResponse
|
||||
) -> HttpResponse: ...
|
||||
|
||||
17
django-stubs/contrib/redirects/models.pyi
Normal file
17
django-stubs/contrib/redirects/models.pyi
Normal file
@@ -0,0 +1,17 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Redirect(models.Model):
|
||||
id: None
|
||||
site_id: int
|
||||
site: Any = ...
|
||||
old_path: str = ...
|
||||
new_path: str = ...
|
||||
class Meta:
|
||||
verbose_name: Any = ...
|
||||
verbose_name_plural: Any = ...
|
||||
db_table: str = ...
|
||||
unique_together: Any = ...
|
||||
ordering: Any = ...
|
||||
@@ -1,12 +1,7 @@
|
||||
# Stubs for django.contrib.sessions.backends.base (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
from typing import Dict, Optional, Union
|
||||
|
||||
VALID_KEY_CHARS: Any
|
||||
|
||||
@@ -16,49 +11,43 @@ class UpdateError(Exception): ...
|
||||
class SessionBase:
|
||||
TEST_COOKIE_NAME: str = ...
|
||||
TEST_COOKIE_VALUE: str = ...
|
||||
__not_given: Any = ...
|
||||
_session_key: Any = ...
|
||||
accessed: bool = ...
|
||||
modified: bool = ...
|
||||
serializer: Any = ...
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def __contains__(self, key: str) -> bool: ...
|
||||
def __getitem__(self, key: str) -> Union[str, Model, int]: ...
|
||||
def __setitem__(self, key: str, value: Union[str, datetime, int]) -> None: ...
|
||||
def __setitem__(
|
||||
self, key: str, value: Union[str, datetime, Model, int]
|
||||
) -> None: ...
|
||||
def __delitem__(self, key: str) -> None: ...
|
||||
def get(
|
||||
self, key: str, default: Optional[str] = ...
|
||||
) -> Optional[Union[str, datetime, int]]: ...
|
||||
def pop(self, key: str, default: object = ...) -> Union[str, int]: ...
|
||||
) -> Optional[Union[str, int, datetime]]: ...
|
||||
def pop(self, key: str, default: Any = ...) -> Union[str, int]: ...
|
||||
def setdefault(self, key: str, value: str) -> str: ...
|
||||
def set_test_cookie(self) -> None: ...
|
||||
def test_cookie_worked(self) -> bool: ...
|
||||
def delete_test_cookie(self) -> None: ...
|
||||
def _hash(self, value: bytes) -> str: ...
|
||||
def encode(self, session_dict: Dict[str, Union[str, int, datetime]]) -> str: ...
|
||||
def decode(self, session_data: Union[str, bytes]) -> Dict[str, Union[str, int]]: ...
|
||||
def encode(
|
||||
self, session_dict: Dict[str, Union[str, int, Model, datetime]]
|
||||
) -> 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 has_key(self, key: Any): ...
|
||||
def keys(self): ...
|
||||
def values(self): ...
|
||||
def items(self): ...
|
||||
_session_cache: Any = ...
|
||||
def clear(self) -> None: ...
|
||||
def is_empty(self) -> bool: ...
|
||||
def _get_new_session_key(self) -> str: ...
|
||||
def _get_or_create_session_key(self) -> str: ...
|
||||
def _validate_session_key(self, key: Optional[str]) -> Optional[Union[str, bool]]: ...
|
||||
def _get_session_key(self) -> Optional[str]: ...
|
||||
__session_key: Any = ...
|
||||
def _set_session_key(self, value: Optional[str]) -> None: ...
|
||||
session_key: Any = ...
|
||||
def _get_session(
|
||||
self, no_load: bool = ...
|
||||
) -> Dict[str, Union[str, int, datetime, Model]]: ...
|
||||
_session: Any = ...
|
||||
def get_expiry_age(self, **kwargs: Any) -> int: ...
|
||||
def get_expiry_date(self, **kwargs: Any) -> datetime: ...
|
||||
def set_expiry(self, value: Optional[Union[datetime, int, timedelta]]) -> None: ...
|
||||
def set_expiry(
|
||||
self, value: Optional[Union[datetime, int, timedelta]]
|
||||
) -> None: ...
|
||||
def get_expire_at_browser_close(self) -> bool: ...
|
||||
def flush(self) -> None: ...
|
||||
def cycle_key(self) -> None: ...
|
||||
|
||||
@@ -1,22 +1,17 @@
|
||||
# Stubs for django.contrib.sessions.backends.cache (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
KEY_PREFIX: str
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
accessed: bool
|
||||
serializer: Type[django.core.signing.JSONSerializer]
|
||||
cache_key_prefix: Any = ...
|
||||
_cache: Any = ...
|
||||
def __init__(self, session_key: None = ...) -> None: ...
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@property
|
||||
def cache_key(self) -> str: ...
|
||||
_session_key: Any = ...
|
||||
def load(self) -> Dict[Any, Any]: ...
|
||||
def load(self) -> Dict[str, str]: ...
|
||||
modified: bool = ...
|
||||
def create(self) -> None: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
# Stubs for django.contrib.sessions.backends.cached_db (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from django.contrib.sessions.backends.db import SessionStore as DBStore
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
KEY_PREFIX: str
|
||||
|
||||
class SessionStore(DBStore):
|
||||
accessed: bool
|
||||
modified: bool
|
||||
serializer: Type[django.core.signing.JSONSerializer]
|
||||
cache_key_prefix: Any = ...
|
||||
_cache: Any = ...
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@property
|
||||
def cache_key(self) -> str: ...
|
||||
def load(self) -> Dict[Any, Any]: ...
|
||||
def exists(self, session_key: str) -> bool: ...
|
||||
def load(self) -> Dict[str, str]: ...
|
||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
_session_key: Any = ...
|
||||
def flush(self) -> None: ...
|
||||
|
||||
@@ -1,28 +1,25 @@
|
||||
# Stubs for django.contrib.sessions.backends.db (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Optional, Type, Union
|
||||
|
||||
from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
from datetime import datetime
|
||||
from django.contrib.sessions.base_session import AbstractBaseSession
|
||||
from django.contrib.sessions.models import Session
|
||||
from typing import Dict, Optional, Type, Union
|
||||
from django.db.models.base import Model
|
||||
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
accessed: bool
|
||||
serializer: Type[django.core.signing.JSONSerializer]
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@classmethod
|
||||
def get_model_class(cls) -> Type[Session]: ...
|
||||
def model(self) -> Type[AbstractBaseSession]: ...
|
||||
_session_key: Any = ...
|
||||
def _get_session_from_db(self) -> Optional[AbstractBaseSession]: ...
|
||||
def load(self) -> Dict[str, Union[str, int]]: ...
|
||||
def load(self) -> Dict[str, Union[Model, str, int]]: ...
|
||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||
modified: bool = ...
|
||||
def create(self) -> None: ...
|
||||
def create_model_instance(
|
||||
self, data: Dict[str, Union[str, int, datetime]]
|
||||
self, data: Dict[str, Union[int, str, Model, datetime]]
|
||||
) -> AbstractBaseSession: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
# Stubs for django.contrib.sessions.backends.file (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Dict, Optional
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
storage_path: Any = ...
|
||||
file_prefix: Any = ...
|
||||
accessed: bool
|
||||
serializer: Type[django.core.signing.JSONSerializer]
|
||||
storage_path: str = ...
|
||||
file_prefix: str = ...
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@classmethod
|
||||
def _get_storage_path(cls) -> str: ...
|
||||
def _key_to_file(self, session_key: Optional[str] = ...) -> str: ...
|
||||
def _last_modification(self): ...
|
||||
def _expiry_date(self, session_data: Any): ...
|
||||
_session_key: Any = ...
|
||||
def load(self) -> Dict[str, str]: ...
|
||||
def load(self) -> Dict[str, Union[str, int]]: ...
|
||||
modified: bool = ...
|
||||
def create(self) -> None: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
|
||||
@@ -1,23 +1,18 @@
|
||||
# Stubs for django.contrib.sessions.backends.signed_cookies (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Dict, Optional, Union
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
accessed: bool
|
||||
serializer: Type[django.core.signing.JSONSerializer]
|
||||
def load(self) -> Dict[str, Union[str, datetime]]: ...
|
||||
modified: bool = ...
|
||||
def create(self) -> None: ...
|
||||
_session_key: Any = ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
def exists(self, session_key: str = ...) -> bool: ...
|
||||
_session_cache: Any = ...
|
||||
def exists(self, session_key: Optional[str] = ...) -> bool: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def cycle_key(self) -> None: ...
|
||||
def _get_session_key(self) -> str: ...
|
||||
@classmethod
|
||||
def clear_expired(cls) -> None: ...
|
||||
|
||||
@@ -1,5 +1,30 @@
|
||||
from typing import Dict
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
class AbstractBaseSession:
|
||||
def __str__(self) -> str: ...
|
||||
from django.db import models
|
||||
|
||||
|
||||
class BaseSessionManager(models.Manager):
|
||||
creation_counter: int
|
||||
model: None
|
||||
name: None
|
||||
def encode(self, session_dict: Dict[str, int]) -> str: ...
|
||||
def save(
|
||||
self,
|
||||
session_key: str,
|
||||
session_dict: Dict[str, int],
|
||||
expire_date: datetime,
|
||||
) -> AbstractBaseSession: ...
|
||||
|
||||
class AbstractBaseSession(models.Model):
|
||||
session_key: Any = ...
|
||||
session_data: Any = ...
|
||||
expire_date: Any = ...
|
||||
objects: Any = ...
|
||||
class Meta:
|
||||
abstract: bool = ...
|
||||
verbose_name: Any = ...
|
||||
verbose_name_plural: Any = ...
|
||||
@classmethod
|
||||
def get_session_store_class(cls) -> None: ...
|
||||
def get_decoded(self) -> Dict[str, int]: ...
|
||||
|
||||
@@ -1,2 +1,11 @@
|
||||
class Command:
|
||||
def handle(self, **options) -> None: ...
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
stderr: django.core.management.base.OutputWrapper
|
||||
stdout: django.core.management.base.OutputWrapper
|
||||
style: django.core.management.color.Style
|
||||
help: str = ...
|
||||
def handle(self, **options: Any) -> None: ...
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
# Stubs for django.contrib.sessions.middleware (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseBase
|
||||
from typing import Callable, Optional
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
|
||||
class SessionMiddleware(MiddlewareMixin):
|
||||
get_response: Any = ...
|
||||
SessionStore: Any = ...
|
||||
get_response: Callable = ...
|
||||
SessionStore: Type[django.contrib.sessions.backends.db.SessionStore] = ...
|
||||
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
||||
def process_request(self, request: WSGIRequest) -> None: ...
|
||||
def process_request(self, request: HttpRequest) -> None: ...
|
||||
def process_response(
|
||||
self, request: WSGIRequest, response: HttpResponseBase
|
||||
) -> HttpResponseBase: ...
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
from django.contrib.sessions.backends.db import SessionStore
|
||||
from typing import Type
|
||||
from typing import Any, Optional, Type
|
||||
|
||||
class Session:
|
||||
from django.contrib.sessions.backends.db import SessionStore
|
||||
from django.contrib.sessions.base_session import (AbstractBaseSession,
|
||||
BaseSessionManager)
|
||||
|
||||
|
||||
class SessionManager(BaseSessionManager):
|
||||
creation_counter: int
|
||||
model: None
|
||||
name: None
|
||||
use_in_migrations: bool = ...
|
||||
|
||||
class Session(AbstractBaseSession):
|
||||
expire_date: datetime.datetime
|
||||
session_data: str
|
||||
session_key: str
|
||||
objects: Any = ...
|
||||
@classmethod
|
||||
def get_session_store_class(cls) -> Type[SessionStore]: ...
|
||||
class Meta(AbstractBaseSession.Meta):
|
||||
db_table: str = ...
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
# Stubs for django.contrib.sessions.serializers (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from django.core.signing import JSONSerializer as BaseJSONSerializer
|
||||
from typing import Any
|
||||
|
||||
from datetime import datetime
|
||||
from django.db.models.base import Model
|
||||
from typing import Dict, Union
|
||||
|
||||
|
||||
class PickleSerializer:
|
||||
def dumps(self, obj: Dict[str, Union[str, datetime]]) -> bytes: ...
|
||||
def loads(self, data: bytes) -> Dict[str, Model]: ...
|
||||
def dumps(self, obj: Dict[str, Union[Model, str, datetime]]) -> bytes: ...
|
||||
def loads(self, data: bytes) -> Dict[str, Union[Model, str, datetime]]: ...
|
||||
|
||||
JSONSerializer = BaseJSONSerializer
|
||||
|
||||
@@ -1,28 +1,21 @@
|
||||
# Stubs for django.contrib.sitemaps (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.contrib.sites.models import Site
|
||||
from django.contrib.sites.requests import RequestSite
|
||||
from django.core.paginator import Paginator
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
PING_URL: str
|
||||
|
||||
class SitemapNotFound(Exception): ...
|
||||
|
||||
def ping_google(sitemap_url: None = ..., ping_url: str = ...) -> None: ...
|
||||
def _get_sitemap_full_url(sitemap_url: None): ...
|
||||
|
||||
class Sitemap:
|
||||
limit: int = ...
|
||||
protocol: Any = ...
|
||||
def __get(self, name: Any, obj: Any, default: Optional[Any] = ...): ...
|
||||
def items(self) -> List[Any]: ...
|
||||
def location(self, obj: Model) -> str: ...
|
||||
@property
|
||||
@@ -33,27 +26,23 @@ class Sitemap:
|
||||
site: Optional[Union[RequestSite, Site]] = ...,
|
||||
protocol: Optional[str] = ...,
|
||||
) -> Union[
|
||||
List[Dict[str, object]], List[Dict[str, Union[Model, str, datetime, None]]]
|
||||
List[Dict[str, Union[Model, str, datetime, None]]], List[Dict[str, Any]]
|
||||
]: ...
|
||||
latest_lastmod: Any = ...
|
||||
def _urls(
|
||||
self, page: Union[str, int], protocol: str, domain: str
|
||||
) -> Union[List[Dict[str, object]], List[Dict[str, Union[Model, str, None]]]]: ...
|
||||
|
||||
class GenericSitemap(Sitemap):
|
||||
priority: Any = ...
|
||||
changefreq: Any = ...
|
||||
queryset: Any = ...
|
||||
date_field: Any = ...
|
||||
protocol: Any = ...
|
||||
priority: None = ...
|
||||
changefreq: None = ...
|
||||
queryset: django.db.models.query.QuerySet = ...
|
||||
date_field: None = ...
|
||||
protocol: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
info_dict: Dict[str, Union[QuerySet, datetime]],
|
||||
info_dict: Dict[str, Union[QuerySet, datetime, str]],
|
||||
priority: Optional[float] = ...,
|
||||
changefreq: Optional[str] = ...,
|
||||
protocol: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def items(self): ...
|
||||
def lastmod(self, item: Model) -> None: ...
|
||||
def items(self) -> QuerySet: ...
|
||||
def lastmod(self, item: Model) -> Optional[datetime]: ...
|
||||
|
||||
default_app_config: str
|
||||
|
||||
@@ -1,2 +1,12 @@
|
||||
class Command:
|
||||
def handle(self, *args, **options) -> None: ...
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.management.base import BaseCommand, CommandParser
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
stderr: django.core.management.base.OutputWrapper
|
||||
stdout: django.core.management.base.OutputWrapper
|
||||
style: django.core.management.color.Style
|
||||
help: str = ...
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, *args: Any, **options: Any) -> None: ...
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
# Stubs for django.contrib.sitemaps.views (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Callable, Dict, Optional, Type, Union
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.flatpages.sitemaps import FlatPageSitemap
|
||||
from django.contrib.sitemaps import GenericSitemap, Sitemap
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.template.response import TemplateResponse
|
||||
from typing import Callable, Dict, Optional, Type, Union
|
||||
|
||||
|
||||
def x_robots_tag(func: Callable) -> Callable: ...
|
||||
def index(
|
||||
request: WSGIRequest,
|
||||
sitemaps: Dict[str, Type[Sitemap]],
|
||||
sitemaps: Dict[str, Union[Type[Sitemap], Sitemap]],
|
||||
template_name: str = ...,
|
||||
content_type: str = ...,
|
||||
sitemap_url_name: str = ...,
|
||||
) -> TemplateResponse: ...
|
||||
def sitemap(
|
||||
request: WSGIRequest,
|
||||
sitemaps: Dict[str, Union[Type[Sitemap], Type[FlatPageSitemap], GenericSitemap]],
|
||||
sitemaps: Union[
|
||||
Dict[str, Type[Sitemap]], Dict[str, GenericSitemap], OrderedDict
|
||||
],
|
||||
section: Optional[str] = ...,
|
||||
template_name: str = ...,
|
||||
content_type: str = ...,
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
# Stubs for django.contrib.sites.apps (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
from .management import create_default_site
|
||||
from django.apps import AppConfig
|
||||
from typing import Any
|
||||
|
||||
|
||||
class SitesConfig(AppConfig):
|
||||
apps: None
|
||||
label: str
|
||||
models: None
|
||||
models_module: None
|
||||
module: Any
|
||||
path: str
|
||||
name: str = ...
|
||||
verbose_name: Any = ...
|
||||
def ready(self) -> None: ...
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
# Stubs for django.contrib.sites.management (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.apps.registry import Apps
|
||||
from django.contrib.sites.apps import SitesConfig
|
||||
|
||||
|
||||
def create_default_site(
|
||||
app_config: SitesConfig,
|
||||
verbosity: int = ...,
|
||||
interactive: bool = ...,
|
||||
using: str = ...,
|
||||
apps: Apps = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user