mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 13:04:47 +08:00
move generated stubs to separate directory, too messty
This commit is contained in:
5
django-stubs-generated/__init__.pyi
Normal file
5
django-stubs-generated/__init__.pyi
Normal file
@@ -0,0 +1,5 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
VERSION: Any
|
||||
|
||||
def setup(set_prefix: bool = ...) -> None: ...
|
||||
2
django-stubs-generated/apps/__init__.pyi
Normal file
2
django-stubs-generated/apps/__init__.pyi
Normal file
@@ -0,0 +1,2 @@
|
||||
from .config import AppConfig as AppConfig
|
||||
from .registry import apps as apps
|
||||
26
django-stubs-generated/apps/config.pyi
Normal file
26
django-stubs-generated/apps/config.pyi
Normal file
@@ -0,0 +1,26 @@
|
||||
from typing import Any, Iterator, Optional, Type
|
||||
|
||||
from django.db.models.base import Model
|
||||
|
||||
MODELS_MODULE_NAME: str
|
||||
|
||||
class AppConfig:
|
||||
name: str = ...
|
||||
module: Any = ...
|
||||
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_models(
|
||||
self, include_auto_created: bool = ..., include_swapped: bool = ...
|
||||
) -> Iterator[Type[Model]]: ...
|
||||
def import_models(self) -> None: ...
|
||||
def ready(self) -> None: ...
|
||||
61
django-stubs-generated/apps/registry.pyi
Normal file
61
django-stubs-generated/apps/registry.pyi
Normal file
@@ -0,0 +1,61 @@
|
||||
from typing import Any, Callable, 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 .config import AppConfig
|
||||
|
||||
|
||||
class Apps:
|
||||
all_models: collections.defaultdict = ...
|
||||
app_configs: collections.OrderedDict = ...
|
||||
stored_app_configs: List[Any] = ...
|
||||
apps_ready: bool = ...
|
||||
loading: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
installed_apps: Optional[
|
||||
Union[List[AppConfigStub], List[str], Tuple]
|
||||
] = ...,
|
||||
) -> None: ...
|
||||
models_ready: bool = ...
|
||||
ready: bool = ...
|
||||
def populate(
|
||||
self, installed_apps: Union[List[AppConfigStub], List[str], Tuple] = ...
|
||||
) -> None: ...
|
||||
def check_apps_ready(self) -> None: ...
|
||||
def check_models_ready(self) -> None: ...
|
||||
def get_app_configs(self): ...
|
||||
def get_app_config(self, app_label: str) -> AppConfig: ...
|
||||
def get_models(
|
||||
self, include_auto_created: bool = ..., include_swapped: bool = ...
|
||||
) -> List[Type[Model]]: ...
|
||||
def get_model(
|
||||
self,
|
||||
app_label: str,
|
||||
model_name: Optional[str] = ...,
|
||||
require_ready: bool = ...,
|
||||
) -> Type[Model]: ...
|
||||
def register_model(self, app_label: str, model: Type[Model]) -> None: ...
|
||||
def is_installed(self, app_name: str) -> bool: ...
|
||||
def get_containing_app_config(
|
||||
self, object_name: str
|
||||
) -> Optional[AppConfig]: ...
|
||||
def get_registered_model(
|
||||
self, app_label: str, model_name: str
|
||||
) -> Type[Model]: ...
|
||||
def get_swappable_settings_name(self, to_string: str) -> Optional[str]: ...
|
||||
def set_available_apps(self, available: List[str]) -> None: ...
|
||||
def unset_available_apps(self) -> None: ...
|
||||
def set_installed_apps(
|
||||
self, installed: Union[List[str], Tuple[str]]
|
||||
) -> None: ...
|
||||
def unset_installed_apps(self) -> None: ...
|
||||
def clear_cache(self) -> None: ...
|
||||
def lazy_model_operation(
|
||||
self, function: Callable, *model_keys: Any
|
||||
) -> None: ...
|
||||
def do_pending_operations(self, model: Type[Model]) -> None: ...
|
||||
|
||||
apps: Any
|
||||
36
django-stubs-generated/conf/__init__.pyi
Normal file
36
django-stubs-generated/conf/__init__.pyi
Normal file
@@ -0,0 +1,36 @@
|
||||
from typing import Any, List, Optional, Union
|
||||
|
||||
from django.utils.functional import LazyObject
|
||||
|
||||
ENVIRONMENT_VARIABLE: str
|
||||
|
||||
class LazySettings(LazyObject):
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __delattr__(self, name: str) -> 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 = ...
|
||||
def __init__(self, settings_module: str) -> None: ...
|
||||
def is_overridden(self, setting: str) -> bool: ...
|
||||
|
||||
class UserSettingsHolder:
|
||||
SETTINGS_MODULE: Any = ...
|
||||
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: str) -> bool: ...
|
||||
|
||||
settings: Any
|
||||
32
django-stubs-generated/conf/urls/__init__.pyi
Normal file
32
django-stubs-generated/conf/urls/__init__.pyi
Normal file
@@ -0,0 +1,32 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.contrib.flatpages.sitemaps import FlatPageSitemap
|
||||
from django.contrib.sitemaps import Sitemap
|
||||
from django.urls import include as include
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
|
||||
handler400: Any
|
||||
handler403: Any
|
||||
handler404: Any
|
||||
handler500: Any
|
||||
|
||||
def url(
|
||||
regex: str,
|
||||
view: Optional[
|
||||
Union[
|
||||
Callable,
|
||||
Tuple[List[Union[URLPattern, URLResolver]], str, str],
|
||||
Tuple[Union[List[URLPattern], List[URLResolver]], None, None],
|
||||
]
|
||||
],
|
||||
kwargs: Optional[
|
||||
Union[
|
||||
Dict[str, Dict[str, Type[FlatPageSitemap]]],
|
||||
Dict[str, Dict[str, Sitemap]],
|
||||
Dict[str, OrderedDict],
|
||||
Dict[str, str],
|
||||
]
|
||||
] = ...,
|
||||
name: Optional[str] = ...,
|
||||
) -> Union[URLPattern, URLResolver]: ...
|
||||
11
django-stubs-generated/conf/urls/i18n.pyi
Normal file
11
django-stubs-generated/conf/urls/i18n.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
|
||||
|
||||
def i18n_patterns(
|
||||
*urls: Any, prefix_default_language: bool = ...
|
||||
) -> Union[List[List[Any]], List[URLPattern], List[URLResolver]]: ...
|
||||
def is_language_prefix_patterns_used(urlconf: str) -> Tuple[bool, bool]: ...
|
||||
|
||||
urlpatterns: Any
|
||||
8
django-stubs-generated/conf/urls/static.pyi
Normal file
8
django-stubs-generated/conf/urls/static.pyi
Normal file
@@ -0,0 +1,8 @@
|
||||
from typing import Any, Callable, List, Optional
|
||||
|
||||
from django.urls.resolvers import URLPattern
|
||||
|
||||
|
||||
def static(
|
||||
prefix: str, view: Callable = ..., **kwargs: Any
|
||||
) -> List[URLPattern]: ...
|
||||
0
django-stubs-generated/contrib/__init__.pyi
Normal file
0
django-stubs-generated/contrib/__init__.pyi
Normal file
30
django-stubs-generated/contrib/admin/__init__.pyi
Normal file
30
django-stubs-generated/contrib/admin/__init__.pyi
Normal file
@@ -0,0 +1,30 @@
|
||||
from typing import Optional
|
||||
|
||||
from django.contrib.admin.decorators import register as register
|
||||
from django.contrib.admin.filters import \
|
||||
AllValuesFieldListFilter as AllValuesFieldListFilter
|
||||
from django.contrib.admin.filters import \
|
||||
BooleanFieldListFilter as BooleanFieldListFilter
|
||||
from django.contrib.admin.filters import \
|
||||
ChoicesFieldListFilter as ChoicesFieldListFilter
|
||||
from django.contrib.admin.filters import \
|
||||
DateFieldListFilter as DateFieldListFilter
|
||||
from django.contrib.admin.filters import 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: ...
|
||||
11
django-stubs-generated/contrib/admin/actions.pyi
Normal file
11
django-stubs-generated/contrib/admin/actions.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
) -> Optional[TemplateResponse]: ...
|
||||
26
django-stubs-generated/contrib/admin/apps.pyi
Normal file
26
django-stubs-generated/contrib/admin/apps.pyi
Normal file
@@ -0,0 +1,26 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
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: ...
|
||||
28
django-stubs-generated/contrib/admin/checks.pyi
Normal file
28
django-stubs-generated/contrib/admin/checks.pyi
Normal file
@@ -0,0 +1,28 @@
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from django.contrib.admin.options import (BaseModelAdmin, InlineModelAdmin,
|
||||
ModelAdmin)
|
||||
from django.core.checks.messages import Error
|
||||
|
||||
|
||||
def check_admin_app(app_configs: None, **kwargs: Any) -> List[str]: ...
|
||||
def check_dependencies(**kwargs: Any) -> List[Error]: ...
|
||||
|
||||
class BaseModelAdminChecks:
|
||||
def check(
|
||||
self, admin_obj: BaseModelAdmin, **kwargs: Any
|
||||
) -> List[Error]: ...
|
||||
|
||||
class ModelAdminChecks(BaseModelAdminChecks):
|
||||
def check(self, admin_obj: ModelAdmin, **kwargs: Any) -> List[Error]: ...
|
||||
|
||||
class InlineModelAdminChecks(BaseModelAdminChecks):
|
||||
def check(
|
||||
self, inline_obj: InlineModelAdmin, **kwargs: Any
|
||||
) -> List[Any]: ...
|
||||
|
||||
def 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
|
||||
): ...
|
||||
4
django-stubs-generated/contrib/admin/decorators.pyi
Normal file
4
django-stubs-generated/contrib/admin/decorators.pyi
Normal file
@@ -0,0 +1,4 @@
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
|
||||
def register(*models: Any, site: Optional[Any] = ...) -> Callable: ...
|
||||
204
django-stubs-generated/contrib/admin/filters.pyi
Normal file
204
django-stubs-generated/contrib/admin/filters.pyi
Normal file
@@ -0,0 +1,204 @@
|
||||
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.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
|
||||
|
||||
|
||||
class ListFilter:
|
||||
title: Any = ...
|
||||
template: str = ...
|
||||
used_parameters: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
model_admin: ModelAdmin,
|
||||
) -> None: ...
|
||||
def has_output(self) -> None: ...
|
||||
def choices(self, changelist: Any) -> None: ...
|
||||
def queryset(self, request: Any, queryset: Any) -> None: ...
|
||||
def expected_parameters(self) -> None: ...
|
||||
|
||||
class SimpleListFilter(ListFilter):
|
||||
parameter_name: Any = ...
|
||||
lookup_choices: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
model_admin: ModelAdmin,
|
||||
) -> None: ...
|
||||
def has_output(self) -> bool: ...
|
||||
def value(self) -> Optional[str]: ...
|
||||
def lookups(self, request: Any, model_admin: Any) -> None: ...
|
||||
def expected_parameters(self): ...
|
||||
def choices(self, changelist: Any) -> None: ...
|
||||
|
||||
class FieldListFilter(ListFilter):
|
||||
field: Any = ...
|
||||
field_path: Any = ...
|
||||
title: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: Union[Field, reverse_related.ForeignObjectRel],
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
model_admin: ModelAdmin,
|
||||
field_path: str,
|
||||
) -> None: ...
|
||||
def has_output(self) -> bool: ...
|
||||
def queryset(
|
||||
self, request: WSGIRequest, queryset: QuerySet
|
||||
) -> QuerySet: ...
|
||||
@classmethod
|
||||
def register(
|
||||
cls,
|
||||
test: Callable,
|
||||
list_filter_class: Type[FieldListFilter],
|
||||
take_priority: bool = ...,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def create(
|
||||
cls,
|
||||
field: Union[Field, reverse_related.ForeignObjectRel],
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
model_admin: ModelAdmin,
|
||||
field_path: str,
|
||||
) -> FieldListFilter: ...
|
||||
|
||||
class RelatedFieldListFilter(FieldListFilter):
|
||||
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: str = ...
|
||||
empty_value_display: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: FieldCacheMixin,
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
model_admin: ModelAdmin,
|
||||
field_path: str,
|
||||
) -> None: ...
|
||||
@property
|
||||
def include_empty_choice(self) -> bool: ...
|
||||
def has_output(self) -> bool: ...
|
||||
def expected_parameters(self) -> List[str]: ...
|
||||
def field_choices(
|
||||
self,
|
||||
field: FieldCacheMixin,
|
||||
request: WSGIRequest,
|
||||
model_admin: ModelAdmin,
|
||||
) -> List[Tuple[Union[int, str], str]]: ...
|
||||
def choices(self, changelist: Any) -> None: ...
|
||||
|
||||
class BooleanFieldListFilter(FieldListFilter):
|
||||
lookup_kwarg: Any = ...
|
||||
lookup_kwarg2: Any = ...
|
||||
lookup_val: Any = ...
|
||||
lookup_val2: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: BooleanField,
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
model_admin: ModelAdmin,
|
||||
field_path: str,
|
||||
) -> None: ...
|
||||
def expected_parameters(self) -> List[str]: ...
|
||||
def choices(self, changelist: Any) -> None: ...
|
||||
|
||||
class ChoicesFieldListFilter(FieldListFilter):
|
||||
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,
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
model_admin: ModelAdmin,
|
||||
field_path: str,
|
||||
) -> None: ...
|
||||
def expected_parameters(self) -> List[str]: ...
|
||||
def choices(self, changelist: Any) -> None: ...
|
||||
|
||||
class DateFieldListFilter(FieldListFilter):
|
||||
field_generic: Any = ...
|
||||
date_params: Any = ...
|
||||
lookup_kwarg_since: Any = ...
|
||||
lookup_kwarg_until: Any = ...
|
||||
links: Any = ...
|
||||
lookup_kwarg_isnull: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: DateField,
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
model_admin: ModelAdmin,
|
||||
field_path: str,
|
||||
) -> None: ...
|
||||
def expected_parameters(self) -> List[str]: ...
|
||||
def choices(self, changelist: Any) -> None: ...
|
||||
|
||||
class AllValuesFieldListFilter(FieldListFilter):
|
||||
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,
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
model_admin: ModelAdmin,
|
||||
field_path: str,
|
||||
) -> None: ...
|
||||
def expected_parameters(self) -> List[str]: ...
|
||||
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: RelatedField, request: WSGIRequest, model_admin: ModelAdmin
|
||||
) -> List[Tuple[Union[int, str], str]]: ...
|
||||
34
django-stubs-generated/contrib/admin/forms.pyi
Normal file
34
django-stubs-generated/contrib/admin/forms.pyi
Normal file
@@ -0,0 +1,34 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
class AdminAuthenticationForm(AuthenticationForm):
|
||||
auto_id: str
|
||||
data: Dict[str, str]
|
||||
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 = ...
|
||||
179
django-stubs-generated/contrib/admin/helpers.pyi
Normal file
179
django-stubs-generated/contrib/admin/helpers.pyi
Normal file
@@ -0,0 +1,179 @@
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django import forms
|
||||
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, Widget
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
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 = ...
|
||||
|
||||
checkbox: Any
|
||||
|
||||
class AdminForm:
|
||||
prepopulated_fields: Any = ...
|
||||
model_admin: Any = ...
|
||||
readonly_fields: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
form: AdminPasswordChangeForm,
|
||||
fieldsets: List[Tuple[None, Dict[str, List[str]]]],
|
||||
prepopulated_fields: Dict[Any, Any],
|
||||
readonly_fields: None = ...,
|
||||
model_admin: None = ...,
|
||||
) -> None: ...
|
||||
def __iter__(self) -> Iterator[Fieldset]: ...
|
||||
@property
|
||||
def errors(self) -> ErrorDict: ...
|
||||
@property
|
||||
def non_field_errors(self) -> Callable: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
|
||||
class Fieldset:
|
||||
form: Any = ...
|
||||
classes: Any = ...
|
||||
description: Any = ...
|
||||
model_admin: Any = ...
|
||||
readonly_fields: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
form: Any,
|
||||
name: Optional[Any] = ...,
|
||||
readonly_fields: Any = ...,
|
||||
fields: Any = ...,
|
||||
classes: Any = ...,
|
||||
description: Optional[Any] = ...,
|
||||
model_admin: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def __iter__(self) -> Iterator[Fieldline]: ...
|
||||
|
||||
class Fieldline:
|
||||
form: Any = ...
|
||||
fields: Any = ...
|
||||
has_visible_field: Any = ...
|
||||
model_admin: Any = ...
|
||||
readonly_fields: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
form: Any,
|
||||
field: Any,
|
||||
readonly_fields: Optional[Any] = ...,
|
||||
model_admin: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def __iter__(self) -> Iterator[Union[AdminField, AdminReadonlyField]]: ...
|
||||
def errors(self) -> SafeText: ...
|
||||
|
||||
class AdminField:
|
||||
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: ...
|
||||
def errors(self) -> SafeText: ...
|
||||
|
||||
class AdminReadonlyField:
|
||||
field: Any = ...
|
||||
form: Any = ...
|
||||
model_admin: Any = ...
|
||||
is_first: Any = ...
|
||||
is_checkbox: bool = ...
|
||||
is_readonly: bool = ...
|
||||
empty_value_display: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
form: Any,
|
||||
field: Any,
|
||||
is_first: Any,
|
||||
model_admin: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def label_tag(self) -> SafeText: ...
|
||||
def contents(self) -> SafeText: ...
|
||||
|
||||
class InlineAdminFormSet:
|
||||
opts: Any = ...
|
||||
formset: Any = ...
|
||||
fieldsets: Any = ...
|
||||
model_admin: Any = ...
|
||||
readonly_fields: Any = ...
|
||||
prepopulated_fields: Any = ...
|
||||
classes: Any = ...
|
||||
has_add_permission: Any = ...
|
||||
has_change_permission: Any = ...
|
||||
has_delete_permission: Any = ...
|
||||
has_view_permission: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
inline: Any,
|
||||
formset: Any,
|
||||
fieldsets: Any,
|
||||
prepopulated_fields: Optional[Any] = ...,
|
||||
readonly_fields: Optional[Any] = ...,
|
||||
model_admin: Optional[Any] = ...,
|
||||
has_add_permission: bool = ...,
|
||||
has_change_permission: bool = ...,
|
||||
has_delete_permission: bool = ...,
|
||||
has_view_permission: bool = ...,
|
||||
) -> None: ...
|
||||
def __iter__(self) -> Iterator[InlineAdminForm]: ...
|
||||
def fields(
|
||||
self
|
||||
) -> Iterator[Dict[str, Union[Dict[str, bool], bool, Widget, str]]]: ...
|
||||
def inline_formset_data(self) -> str: ...
|
||||
@property
|
||||
def forms(self): ...
|
||||
@property
|
||||
def non_form_errors(self) -> Callable: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
|
||||
class InlineAdminForm(AdminForm):
|
||||
formset: Any = ...
|
||||
model_admin: Any = ...
|
||||
original: Any = ...
|
||||
show_url: Any = ...
|
||||
absolute_url: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
formset: Any,
|
||||
form: Any,
|
||||
fieldsets: Any,
|
||||
prepopulated_fields: Any,
|
||||
original: Any,
|
||||
readonly_fields: Optional[Any] = ...,
|
||||
model_admin: Optional[Any] = ...,
|
||||
view_on_site_url: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def __iter__(self) -> Iterator[InlineFieldset]: ...
|
||||
def needs_explicit_pk_field(self) -> Union[bool, AutoField]: ...
|
||||
def pk_field(self) -> AdminField: ...
|
||||
def fk_field(self) -> AdminField: ...
|
||||
def deletion_field(self) -> AdminField: ...
|
||||
def ordering_field(self): ...
|
||||
|
||||
class InlineFieldset(Fieldset):
|
||||
formset: Any = ...
|
||||
def __init__(self, formset: Any, *args: Any, **kwargs: Any) -> None: ...
|
||||
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: ...
|
||||
53
django-stubs-generated/contrib/admin/models.pyi
Normal file
53
django-stubs-generated/contrib/admin/models.pyi
Normal file
@@ -0,0 +1,53 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.db import models
|
||||
from django.db.models.base import Model
|
||||
|
||||
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: Union[int, str, UUID],
|
||||
object_repr: str,
|
||||
action_flag: int,
|
||||
change_message: Union[
|
||||
Dict[str, Dict[str, List[str]]],
|
||||
List[Dict[str, Dict[str, Union[List[str], str]]]],
|
||||
str,
|
||||
] = ...,
|
||||
) -> 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]: ...
|
||||
414
django-stubs-generated/contrib/admin/options.pyi
Normal file
414
django-stubs-generated/contrib/admin/options.pyi
Normal file
@@ -0,0 +1,414 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from django.contrib.admin.filters import SimpleListFilter
|
||||
from django.contrib.admin.models import LogEntry
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.contrib.admin.views.main import ChangeList
|
||||
from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||
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,
|
||||
RelatedField)
|
||||
from django.db.models.query import QuerySet
|
||||
from django.forms.fields import Field, TypedChoiceField
|
||||
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
|
||||
from django.forms.widgets import Media
|
||||
from django.http.response import (HttpResponse, HttpResponseBase,
|
||||
HttpResponseRedirect, JsonResponse)
|
||||
from django.urls.resolvers import URLPattern
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
IS_POPUP_VAR: str
|
||||
TO_FIELD_VAR: str
|
||||
HORIZONTAL: Any
|
||||
VERTICAL: Any
|
||||
|
||||
def get_content_type_for_model(
|
||||
obj: Union[Type[Model], Model]
|
||||
) -> ContentType: ...
|
||||
def get_ul_class(radio_style: int) -> str: ...
|
||||
|
||||
class IncorrectLookupParameters(Exception): ...
|
||||
|
||||
FORMFIELD_FOR_DBFIELD_DEFAULTS: Any
|
||||
csrf_protect_m: Any
|
||||
|
||||
class BaseModelAdmin:
|
||||
autocomplete_fields: Any = ...
|
||||
raw_id_fields: Any = ...
|
||||
fields: Any = ...
|
||||
exclude: Any = ...
|
||||
fieldsets: Any = ...
|
||||
form: Any = ...
|
||||
filter_vertical: Any = ...
|
||||
filter_horizontal: Any = ...
|
||||
radio_fields: Any = ...
|
||||
prepopulated_fields: Any = ...
|
||||
formfield_overrides: Any = ...
|
||||
readonly_fields: Any = ...
|
||||
ordering: Any = ...
|
||||
sortable_by: Any = ...
|
||||
view_on_site: bool = ...
|
||||
show_full_result_count: bool = ...
|
||||
checks_class: Any = ...
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
def __init__(self) -> None: ...
|
||||
def formfield_for_dbfield(
|
||||
self, db_field: Field, request: WSGIRequest, **kwargs: Any
|
||||
) -> Optional[Field]: ...
|
||||
def formfield_for_choice_field(
|
||||
self, db_field: Field, request: WSGIRequest, **kwargs: Any
|
||||
) -> TypedChoiceField: ...
|
||||
def get_field_queryset(
|
||||
self, db: None, db_field: RelatedField, request: WSGIRequest
|
||||
) -> Optional[QuerySet]: ...
|
||||
def formfield_for_foreignkey(
|
||||
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: WSGIRequest) -> Tuple: ...
|
||||
def get_view_on_site_url(
|
||||
self, obj: Optional[Model] = ...
|
||||
) -> Optional[str]: ...
|
||||
def get_empty_value_display(self) -> SafeText: ...
|
||||
def get_exclude(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> None: ...
|
||||
def get_fields(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> Union[List[Union[Callable, str]], Tuple[str, str]]: ...
|
||||
def get_fieldsets(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> Union[
|
||||
List[Tuple[None, Dict[str, List[Union[Callable, str]]]]],
|
||||
Tuple[
|
||||
Tuple[Optional[str], Dict[str, Tuple[Union[Tuple[str, str], str]]]]
|
||||
],
|
||||
]: ...
|
||||
def get_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
||||
def get_readonly_fields(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> Union[List[str], Tuple]: ...
|
||||
def get_prepopulated_fields(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> Dict[str, Tuple[str]]: ...
|
||||
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
||||
def get_sortable_by(
|
||||
self, request: WSGIRequest
|
||||
) -> Union[List[Callable], List[str], Tuple]: ...
|
||||
def lookup_allowed(self, lookup: str, value: str) -> bool: ...
|
||||
def to_field_allowed(self, request: WSGIRequest, to_field: str) -> bool: ...
|
||||
def has_add_permission(self, request: WSGIRequest) -> bool: ...
|
||||
def has_change_permission(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> bool: ...
|
||||
def has_delete_permission(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> bool: ...
|
||||
def has_view_permission(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> bool: ...
|
||||
def has_module_permission(self, request: WSGIRequest) -> bool: ...
|
||||
|
||||
class ModelAdmin(BaseModelAdmin):
|
||||
formfield_overrides: Dict[
|
||||
Type[
|
||||
Union[
|
||||
django.db.models.fields.DateTimeCheckMixin,
|
||||
django.db.models.fields.Field,
|
||||
]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
Union[
|
||||
django.forms.fields.SplitDateTimeField,
|
||||
django.forms.widgets.Widget,
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
list_display: Any = ...
|
||||
list_display_links: Any = ...
|
||||
list_filter: Any = ...
|
||||
list_select_related: bool = ...
|
||||
list_per_page: int = ...
|
||||
list_max_show_all: int = ...
|
||||
list_editable: Any = ...
|
||||
search_fields: Any = ...
|
||||
date_hierarchy: Any = ...
|
||||
save_as: bool = ...
|
||||
save_as_continue: bool = ...
|
||||
save_on_top: bool = ...
|
||||
paginator: Any = ...
|
||||
preserve_filters: bool = ...
|
||||
inlines: Any = ...
|
||||
add_form_template: Any = ...
|
||||
change_form_template: Any = ...
|
||||
change_list_template: Any = ...
|
||||
delete_confirmation_template: Any = ...
|
||||
delete_selected_confirmation_template: Any = ...
|
||||
object_history_template: Any = ...
|
||||
popup_response_template: Any = ...
|
||||
actions: Any = ...
|
||||
action_form: Any = ...
|
||||
actions_on_top: bool = ...
|
||||
actions_on_bottom: bool = ...
|
||||
actions_selection_counter: bool = ...
|
||||
checks_class: 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: Type[Model], admin_site: Optional[AdminSite]
|
||||
) -> None: ...
|
||||
def get_inline_instances(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ...
|
||||
) -> List[InlineModelAdmin]: ...
|
||||
def get_urls(self) -> List[URLPattern]: ...
|
||||
@property
|
||||
def urls(self) -> List[URLPattern]: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def get_model_perms(self, request: WSGIRequest) -> Dict[str, bool]: ...
|
||||
def get_form(
|
||||
self,
|
||||
request: Any,
|
||||
obj: Optional[Any] = ...,
|
||||
change: bool = ...,
|
||||
**kwargs: Any
|
||||
): ...
|
||||
def get_changelist(
|
||||
self, request: WSGIRequest, **kwargs: Any
|
||||
) -> Type[ChangeList]: ...
|
||||
def get_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 = ...,
|
||||
) -> Paginator: ...
|
||||
def log_addition(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
object: Model,
|
||||
message: Union[
|
||||
Dict[str, Dict[Any, Any]], List[Dict[str, Dict[str, str]]]
|
||||
],
|
||||
) -> LogEntry: ...
|
||||
def log_change(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
object: Model,
|
||||
message: Union[
|
||||
Dict[str, Dict[str, List[str]]],
|
||||
List[Dict[str, Dict[str, Union[List[str], str]]]],
|
||||
],
|
||||
) -> LogEntry: ...
|
||||
def log_deletion(
|
||||
self, request: WSGIRequest, object: Model, object_repr: str
|
||||
) -> LogEntry: ...
|
||||
def action_checkbox(self, obj: Model) -> SafeText: ...
|
||||
def get_actions(self, request: WSGIRequest) -> OrderedDict: ...
|
||||
def get_action_choices(
|
||||
self, request: WSGIRequest, default_choices: List[Tuple[str, str]] = ...
|
||||
) -> List[Tuple[str, str]]: ...
|
||||
def get_action(
|
||||
self, action: Union[Callable, str]
|
||||
) -> Tuple[Callable, str, str]: ...
|
||||
def get_list_display(
|
||||
self, request: WSGIRequest
|
||||
) -> Union[List[Callable], List[str], Tuple[str]]: ...
|
||||
def get_list_display_links(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
list_display: Union[List[Callable], List[str], Tuple[str]],
|
||||
) -> Optional[Union[List[Callable], List[str], Tuple[str]]]: ...
|
||||
def get_list_filter(
|
||||
self, request: WSGIRequest
|
||||
) -> Union[List[Type[SimpleListFilter]], List[str], Tuple]: ...
|
||||
def get_list_select_related(
|
||||
self, request: WSGIRequest
|
||||
) -> Union[Tuple, bool]: ...
|
||||
def get_search_fields(
|
||||
self, request: WSGIRequest
|
||||
) -> Union[List[str], Tuple]: ...
|
||||
def get_search_results(
|
||||
self, request: WSGIRequest, queryset: QuerySet, search_term: str
|
||||
) -> Tuple[QuerySet, bool]: ...
|
||||
def get_preserved_filters(self, request: WSGIRequest) -> str: ...
|
||||
def construct_change_message(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
form: AdminPasswordChangeForm,
|
||||
formsets: None,
|
||||
add: bool = ...,
|
||||
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||
def message_user(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
level: Union[int, str] = ...,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: bool = ...,
|
||||
) -> 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: WSGIRequest, obj: Model) -> None: ...
|
||||
def delete_queryset(
|
||||
self, request: WSGIRequest, queryset: QuerySet
|
||||
) -> None: ...
|
||||
def save_formset(
|
||||
self, request: Any, form: Any, formset: Any, change: Any
|
||||
) -> None: ...
|
||||
def save_related(
|
||||
self, request: Any, form: Any, formsets: Any, change: Any
|
||||
) -> None: ...
|
||||
def render_change_form(
|
||||
self,
|
||||
request: Any,
|
||||
context: Any,
|
||||
add: bool = ...,
|
||||
change: bool = ...,
|
||||
form_url: str = ...,
|
||||
obj: Optional[Any] = ...,
|
||||
): ...
|
||||
def response_add(
|
||||
self, request: WSGIRequest, obj: Model, post_url_continue: None = ...
|
||||
) -> HttpResponse: ...
|
||||
def response_change(
|
||||
self, request: WSGIRequest, obj: Model
|
||||
) -> HttpResponse: ...
|
||||
def response_post_save_add(
|
||||
self, request: WSGIRequest, obj: Model
|
||||
) -> HttpResponseRedirect: ...
|
||||
def response_post_save_change(
|
||||
self, request: WSGIRequest, obj: Model
|
||||
) -> HttpResponseRedirect: ...
|
||||
def response_action(
|
||||
self, request: WSGIRequest, queryset: QuerySet
|
||||
) -> Optional[HttpResponseBase]: ...
|
||||
def response_delete(
|
||||
self, request: WSGIRequest, obj_display: str, obj_id: int
|
||||
) -> HttpResponse: ...
|
||||
def render_delete_form(self, request: Any, context: Any): ...
|
||||
def get_inline_formsets(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
formsets: List[Any],
|
||||
inline_instances: List[Any],
|
||||
obj: Optional[Model] = ...,
|
||||
) -> List[Any]: ...
|
||||
def get_changeform_initial_data(
|
||||
self, request: WSGIRequest
|
||||
) -> Dict[str, str]: ...
|
||||
def changeform_view(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
object_id: Optional[str] = ...,
|
||||
form_url: str = ...,
|
||||
extra_context: Optional[Dict[str, bool]] = ...,
|
||||
) -> Any: ...
|
||||
def autocomplete_view(self, request: WSGIRequest) -> JsonResponse: ...
|
||||
def add_view(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
form_url: str = ...,
|
||||
extra_context: None = ...,
|
||||
) -> HttpResponse: ...
|
||||
def change_view(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
object_id: str,
|
||||
form_url: str = ...,
|
||||
extra_context: Optional[Dict[str, bool]] = ...,
|
||||
) -> HttpResponse: ...
|
||||
def changelist_view(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
extra_context: Optional[Dict[str, str]] = ...,
|
||||
) -> HttpResponseBase: ...
|
||||
def get_deleted_objects(
|
||||
self, objs: QuerySet, request: WSGIRequest
|
||||
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
||||
def delete_view(
|
||||
self, request: WSGIRequest, object_id: str, extra_context: None = ...
|
||||
) -> Any: ...
|
||||
def history_view(
|
||||
self, request: WSGIRequest, object_id: str, extra_context: None = ...
|
||||
) -> HttpResponse: ...
|
||||
|
||||
class InlineModelAdmin(BaseModelAdmin):
|
||||
model: Any = ...
|
||||
fk_name: Any = ...
|
||||
formset: Any = ...
|
||||
extra: int = ...
|
||||
min_num: Any = ...
|
||||
max_num: Any = ...
|
||||
template: Any = ...
|
||||
verbose_name: Any = ...
|
||||
verbose_name_plural: Any = ...
|
||||
can_delete: bool = ...
|
||||
show_change_link: bool = ...
|
||||
checks_class: Any = ...
|
||||
classes: Any = ...
|
||||
admin_site: Any = ...
|
||||
parent_model: Any = ...
|
||||
opts: Any = ...
|
||||
has_registered_model: Any = ...
|
||||
def __init__(
|
||||
self, parent_model: Union[Type[Model], Model], admin_site: AdminSite
|
||||
) -> None: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def get_extra(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any
|
||||
) -> int: ...
|
||||
def get_min_num(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def get_max_num(
|
||||
self, request: WSGIRequest, obj: Optional[Model] = ..., **kwargs: Any
|
||||
) -> Optional[int]: ...
|
||||
fields: 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 = ...
|
||||
|
||||
class TabularInline(InlineModelAdmin):
|
||||
template: str = ...
|
||||
85
django-stubs-generated/contrib/admin/sites.pyi
Normal file
85
django-stubs-generated/contrib/admin/sites.pyi
Normal file
@@ -0,0 +1,85 @@
|
||||
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
|
||||
from django.template.response import TemplateResponse
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
from django.utils.functional import LazyObject
|
||||
|
||||
all_sites: Any
|
||||
|
||||
class AlreadyRegistered(Exception): ...
|
||||
class NotRegistered(Exception): ...
|
||||
|
||||
class AdminSite:
|
||||
site_title: Any = ...
|
||||
site_header: Any = ...
|
||||
index_title: Any = ...
|
||||
site_url: str = ...
|
||||
login_form: Any = ...
|
||||
index_template: Any = ...
|
||||
app_index_template: Any = ...
|
||||
login_template: Any = ...
|
||||
logout_template: Any = ...
|
||||
password_change_template: Any = ...
|
||||
password_change_done_template: Any = ...
|
||||
name: str = ...
|
||||
def __init__(self, name: str = ...) -> None: ...
|
||||
def check(self, app_configs: None) -> List[str]: ...
|
||||
def register(
|
||||
self,
|
||||
model_or_iterable: Union[
|
||||
List[Type[Model]], Tuple[Type[Model]], 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: str) -> None: ...
|
||||
def get_action(self, name: str) -> Callable: ...
|
||||
@property
|
||||
def actions(self): ...
|
||||
@property
|
||||
def empty_value_display(self): ...
|
||||
@empty_value_display.setter
|
||||
def empty_value_display(self, empty_value_display: Any) -> None: ...
|
||||
def has_permission(self, request: WSGIRequest) -> bool: ...
|
||||
def admin_view(self, view: Callable, cacheable: bool = ...) -> Callable: ...
|
||||
def get_urls(self) -> List[Union[URLPattern, URLResolver]]: ...
|
||||
@property
|
||||
def urls(self) -> Tuple[List[Union[URLPattern, URLResolver]], str, str]: ...
|
||||
def each_context(self, request: Any): ...
|
||||
def password_change(
|
||||
self, request: WSGIRequest, extra_context: Dict[str, str] = ...
|
||||
) -> TemplateResponse: ...
|
||||
def password_change_done(
|
||||
self, request: WSGIRequest, extra_context: None = ...
|
||||
) -> TemplateResponse: ...
|
||||
def i18n_javascript(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
extra_context: Optional[Dict[Any, Any]] = ...,
|
||||
) -> HttpResponse: ...
|
||||
def logout(
|
||||
self, request: WSGIRequest, extra_context: None = ...
|
||||
) -> TemplateResponse: ...
|
||||
def login(
|
||||
self, request: WSGIRequest, extra_context: None = ...
|
||||
) -> HttpResponse: ...
|
||||
def get_app_list(self, request: WSGIRequest) -> List[Any]: ...
|
||||
def index(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
extra_context: Optional[Dict[str, str]] = ...,
|
||||
) -> TemplateResponse: ...
|
||||
def app_index(
|
||||
self, request: WSGIRequest, app_label: str, extra_context: None = ...
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
class DefaultAdminSite(LazyObject): ...
|
||||
|
||||
site: Any
|
||||
@@ -0,0 +1,59 @@
|
||||
from typing import Any, Dict, Iterator, List, Optional, Union
|
||||
|
||||
from django.contrib.admin.filters import FieldListFilter
|
||||
from django.contrib.admin.templatetags.base import InclusionAdminNode
|
||||
from django.contrib.admin.views.main import ChangeList
|
||||
from django.db.models.base import Model
|
||||
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 .base import InclusionAdminNode
|
||||
|
||||
register: Any
|
||||
DOT: str
|
||||
|
||||
def paginator_number(cl: ChangeList, i: int) -> SafeText: ...
|
||||
def pagination(
|
||||
cl: ChangeList
|
||||
) -> Dict[str, Union[List[Union[int, str]], ChangeList, int, range, str]]: ...
|
||||
def pagination_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def result_headers(
|
||||
cl: ChangeList
|
||||
) -> Iterator[Dict[str, Optional[Union[int, str]]]]: ...
|
||||
def items_for_result(
|
||||
cl: ChangeList, result: Model, form: None
|
||||
) -> Iterator[SafeText]: ...
|
||||
|
||||
class ResultList(list):
|
||||
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,
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[int, str]]]],
|
||||
List[ResultList],
|
||||
List[BoundField],
|
||||
ChangeList,
|
||||
int,
|
||||
],
|
||||
]: ...
|
||||
def result_list_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def date_hierarchy(
|
||||
cl: ChangeList
|
||||
) -> Optional[Dict[str, Union[Dict[str, str], List[Dict[str, str]], bool]]]: ...
|
||||
def date_hierarchy_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def search_form(cl: ChangeList) -> Dict[str, Union[bool, ChangeList, str]]: ...
|
||||
def search_form_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def admin_list_filter(cl: ChangeList, spec: FieldListFilter) -> SafeText: ...
|
||||
def admin_actions(context: RequestContext) -> RequestContext: ...
|
||||
def admin_actions_tag(parser: Parser, token: Token) -> InclusionAdminNode: ...
|
||||
def change_list_object_tools_tag(
|
||||
parser: Parser, token: Token
|
||||
) -> InclusionAdminNode: ...
|
||||
@@ -0,0 +1,21 @@
|
||||
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 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 cell_count(inline_admin_form: InlineAdminForm) -> int: ...
|
||||
@@ -0,0 +1,5 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
register: Any
|
||||
|
||||
def static(path: str) -> str: ...
|
||||
@@ -0,0 +1,17 @@
|
||||
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
|
||||
|
||||
register: Any
|
||||
|
||||
def admin_urlname(value: Options, arg: SafeText) -> str: ...
|
||||
def admin_urlquote(value: Union[int, str, UUID]) -> Union[int, str, UUID]: ...
|
||||
def add_preserved_filters(
|
||||
context: Union[Dict[str, Union[Options, str]], RequestContext],
|
||||
url: str,
|
||||
popup: bool = ...,
|
||||
to_field: Optional[str] = ...,
|
||||
) -> str: ...
|
||||
23
django-stubs-generated/contrib/admin/templatetags/base.pyi
Normal file
23
django-stubs-generated/contrib/admin/templatetags/base.pyi
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
|
||||
|
||||
class InclusionAdminNode(InclusionNode):
|
||||
args: List[Any]
|
||||
func: Callable
|
||||
kwargs: Dict[Any, Any]
|
||||
takes_context: bool
|
||||
template_name: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
parser: Parser,
|
||||
token: Token,
|
||||
func: Callable,
|
||||
template_name: str,
|
||||
takes_context: bool = ...,
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
18
django-stubs-generated/contrib/admin/templatetags/log.pyi
Normal file
18
django-stubs-generated/contrib/admin/templatetags/log.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
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 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: ...
|
||||
110
django-stubs-generated/contrib/admin/utils.pyi
Normal file
110
django-stubs-generated/contrib/admin/utils.pyi
Normal file
@@ -0,0 +1,110 @@
|
||||
from datetime import datetime
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.contrib.admin.options import BaseModelAdmin
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.deletion import Collector
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
||||
ManyToOneRel, OneToOneRel)
|
||||
from django.db.models.options import Options
|
||||
from django.db.models.query import QuerySet
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
|
||||
class FieldIsAForeignKeyColumnName(Exception): ...
|
||||
|
||||
def lookup_needs_distinct(opts: Options, lookup_path: str) -> bool: ...
|
||||
def prepare_lookup_value(
|
||||
key: str, value: Union[datetime, str]
|
||||
) -> Union[bool, datetime, str]: ...
|
||||
def quote(s: Union[int, str, UUID]) -> Union[int, str, UUID]: ...
|
||||
def unquote(s: str) -> str: ...
|
||||
def flatten(
|
||||
fields: Union[
|
||||
List[Union[Callable, str]],
|
||||
List[Union[List[str], str]],
|
||||
List[Union[Tuple[str, str], str]],
|
||||
Tuple,
|
||||
]
|
||||
) -> List[Union[Callable, str]]: ...
|
||||
def flatten_fieldsets(
|
||||
fieldsets: Union[
|
||||
List[Tuple[Optional[str], Dict[str, Tuple[str]]]],
|
||||
Tuple[
|
||||
Tuple[Optional[str], Dict[str, Tuple[Union[Tuple[str, str], str]]]]
|
||||
],
|
||||
]
|
||||
) -> List[Union[Callable, str]]: ...
|
||||
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 = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def add_edge(self, source: Optional[Model], target: Model) -> None: ...
|
||||
def collect(
|
||||
self,
|
||||
objs: Union[List[Model], QuerySet],
|
||||
source: Optional[Type[Model]] = ...,
|
||||
source_attr: Optional[str] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def related_objects(
|
||||
self, related: ManyToOneRel, objs: List[Model]
|
||||
) -> QuerySet: ...
|
||||
def nested(
|
||||
self, format_callback: Callable = ...
|
||||
) -> Union[List[SafeText], List[int]]: ...
|
||||
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ...
|
||||
|
||||
def model_format_dict(obj: Any): ...
|
||||
def model_ngettext(
|
||||
obj: Union[Options, QuerySet], n: Optional[int] = ...
|
||||
) -> str: ...
|
||||
def lookup_field(
|
||||
name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ...
|
||||
) -> Tuple[Optional[Field], Callable, Callable]: ...
|
||||
def label_for_field(
|
||||
name: Union[Callable, str],
|
||||
model: Type[Model],
|
||||
model_admin: Optional[BaseModelAdmin] = ...,
|
||||
return_attr: bool = ...,
|
||||
) -> Union[Tuple[Optional[str], Union[Callable, Type[str]]], str]: ...
|
||||
def help_text_for_field(name: str, model: Type[Model]) -> str: ...
|
||||
def display_for_field(
|
||||
value: Any,
|
||||
field: Union[Field, reverse_related.OneToOneRel],
|
||||
empty_value_display: str,
|
||||
) -> str: ...
|
||||
def display_for_value(
|
||||
value: Any, empty_value_display: str, boolean: bool = ...
|
||||
) -> str: ...
|
||||
|
||||
class NotRelationField(Exception): ...
|
||||
|
||||
def get_model_from_relation(
|
||||
field: Union[Field, reverse_related.ForeignObjectRel]
|
||||
) -> Type[Model]: ...
|
||||
def reverse_field_path(
|
||||
model: Type[Model], path: str
|
||||
) -> Tuple[Type[Model], str]: ...
|
||||
def get_fields_from_path(
|
||||
model: Type[Model], path: str
|
||||
) -> List[Union[Field, FieldCacheMixin]]: ...
|
||||
def construct_change_message(
|
||||
form: AdminPasswordChangeForm, formsets: None, add: bool
|
||||
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||
21
django-stubs-generated/contrib/admin/views/autocomplete.pyi
Normal file
21
django-stubs-generated/contrib/admin/views/autocomplete.pyi
Normal file
@@ -0,0 +1,21 @@
|
||||
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: 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_paginator(self, *args: Any, **kwargs: Any) -> Paginator: ...
|
||||
def get_queryset(self) -> QuerySet: ...
|
||||
def has_perm(self, request: WSGIRequest, obj: None = ...) -> bool: ...
|
||||
@@ -0,0 +1,8 @@
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
|
||||
def staff_member_required(
|
||||
view_func: Optional[Callable] = ...,
|
||||
redirect_field_name: str = ...,
|
||||
login_url: str = ...,
|
||||
) -> Callable: ...
|
||||
92
django-stubs-generated/contrib/admin/views/main.pyi
Normal file
92
django-stubs-generated/contrib/admin/views/main.pyi
Normal file
@@ -0,0 +1,92 @@
|
||||
from collections import OrderedDict
|
||||
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 (Combinable, CombinedExpression,
|
||||
OrderBy)
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
ALL_VAR: str
|
||||
ORDER_VAR: str
|
||||
ORDER_TYPE_VAR: str
|
||||
PAGE_VAR: str
|
||||
SEARCH_VAR: str
|
||||
ERROR_FLAG: str
|
||||
IGNORED_PARAMS: Any
|
||||
|
||||
class ChangeList:
|
||||
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 = ...
|
||||
def __init__(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
model: Type[Model],
|
||||
list_display: Union[List[Union[Callable, str]], Tuple[str]],
|
||||
list_display_links: Optional[
|
||||
Union[List[Callable], List[str], Tuple[str]]
|
||||
],
|
||||
list_filter: Union[List[Type[SimpleListFilter]], List[str], Tuple],
|
||||
date_hierarchy: Optional[str],
|
||||
search_fields: Union[List[str], Tuple],
|
||||
list_select_related: Union[Tuple, bool],
|
||||
list_per_page: int,
|
||||
list_max_show_all: int,
|
||||
list_editable: Union[List[str], Tuple],
|
||||
model_admin: ModelAdmin,
|
||||
sortable_by: Union[List[Callable], List[str], Tuple],
|
||||
) -> None: ...
|
||||
def get_filters_params(self, params: None = ...) -> Dict[str, str]: ...
|
||||
def get_filters(
|
||||
self, request: WSGIRequest
|
||||
) -> Tuple[List[ListFilter], bool, Dict[str, Union[bool, str]], bool]: ...
|
||||
def get_query_string(
|
||||
self,
|
||||
new_params: Optional[Dict[str, None]] = ...,
|
||||
remove: Optional[List[str]] = ...,
|
||||
) -> str: ...
|
||||
result_count: Any = ...
|
||||
show_full_result_count: Any = ...
|
||||
show_admin_actions: Any = ...
|
||||
full_result_count: Any = ...
|
||||
result_list: Any = ...
|
||||
can_show_all: Any = ...
|
||||
multi_page: Any = ...
|
||||
paginator: Any = ...
|
||||
def get_results(self, request: WSGIRequest) -> None: ...
|
||||
def get_ordering_field(
|
||||
self, field_name: Union[Callable, str]
|
||||
) -> Optional[Union[CombinedExpression, str]]: ...
|
||||
def get_ordering(
|
||||
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: ...
|
||||
def has_related_field_in_list_display(self) -> bool: ...
|
||||
def url_for_result(self, result: Model) -> str: ...
|
||||
305
django-stubs-generated/contrib/admin/widgets.pyi
Normal file
305
django-stubs-generated/contrib/admin/widgets.pyi
Normal file
@@ -0,0 +1,305 @@
|
||||
from collections import OrderedDict
|
||||
from datetime import datetime
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django import forms
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||
from django.db.models.query_utils import Q
|
||||
from django.forms.fields import Field
|
||||
from django.forms.widgets import ChoiceWidget, Media, Widget
|
||||
from django.http.request import QueryDict
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
|
||||
|
||||
class FilteredSelectMultiple(forms.SelectMultiple):
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
verbose_name: Any = ...
|
||||
is_stacked: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: str,
|
||||
is_stacked: bool,
|
||||
attrs: None = ...,
|
||||
choices: Tuple = ...,
|
||||
) -> None: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Union[List[Any], str],
|
||||
attrs: Optional[Dict[str, str]],
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[int, str]],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[Dict[str, Union[Dict[Any, Any], int, str]]],
|
||||
int,
|
||||
]
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Dict[str, Union[int, str]], List[str], bool, str]],
|
||||
],
|
||||
]: ...
|
||||
|
||||
class AdminDateWidget(forms.DateInput):
|
||||
attrs: Dict[str, str]
|
||||
input_type: str
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: Optional[Dict[str, Union[int, str]]] = ...,
|
||||
format: None = ...,
|
||||
) -> None: ...
|
||||
|
||||
class AdminTimeWidget(forms.TimeInput):
|
||||
attrs: Dict[str, str]
|
||||
input_type: str
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: Optional[Dict[str, Union[int, str]]] = ...,
|
||||
format: None = ...,
|
||||
) -> None: ...
|
||||
|
||||
class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
||||
attrs: Dict[Any, Any]
|
||||
widgets: List[django.forms.widgets.DateTimeBaseInput]
|
||||
template_name: str = ...
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[List[str], datetime]],
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]], bool, str
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
]
|
||||
],
|
||||
],
|
||||
str,
|
||||
],
|
||||
]: ...
|
||||
|
||||
class AdminRadioSelect(forms.RadioSelect):
|
||||
attrs: Dict[str, str]
|
||||
template_name: str = ...
|
||||
|
||||
class AdminFileWidget(forms.ClearableFileInput):
|
||||
attrs: Dict[Any, Any]
|
||||
template_name: str = ...
|
||||
|
||||
def url_params_from_lookup_dict(
|
||||
lookups: Union[
|
||||
Dict[str, Callable],
|
||||
Dict[str, List[str]],
|
||||
Dict[str, Tuple[str, str]],
|
||||
Dict[str, bool],
|
||||
Dict[str, str],
|
||||
Q,
|
||||
]
|
||||
) -> Dict[str, str]: ...
|
||||
|
||||
class ForeignKeyRawIdWidget(forms.TextInput):
|
||||
attrs: Dict[Any, Any]
|
||||
template_name: str = ...
|
||||
rel: django.db.models.fields.reverse_related.ManyToOneRel = ...
|
||||
admin_site: django.contrib.admin.sites.AdminSite = ...
|
||||
db: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
rel: ForeignObjectRel,
|
||||
admin_site: AdminSite,
|
||||
attrs: None = ...,
|
||||
using: None = ...,
|
||||
) -> None: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[List[int], int, str, UUID]],
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Optional[Union[Dict[str, Union[bool, str]], bool, str]]],
|
||||
str,
|
||||
],
|
||||
]: ...
|
||||
def base_url_parameters(self) -> Dict[str, str]: ...
|
||||
def url_parameters(self) -> Dict[str, str]: ...
|
||||
def label_and_url_for_value(
|
||||
self, value: Union[int, str, UUID]
|
||||
) -> Tuple[str, str]: ...
|
||||
|
||||
class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
|
||||
admin_site: django.contrib.admin.sites.AdminSite
|
||||
attrs: Dict[Any, Any]
|
||||
db: None
|
||||
rel: django.db.models.fields.reverse_related.ManyToManyRel
|
||||
template_name: str = ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[List[int]],
|
||||
attrs: Optional[Dict[str, str]],
|
||||
) -> Dict[str, Union[Dict[str, Union[Dict[str, str], bool, str]], str]]: ...
|
||||
def url_parameters(self) -> Dict[Any, Any]: ...
|
||||
def label_and_url_for_value(self, value: List[int]) -> Tuple[str, str]: ...
|
||||
def value_from_datadict(
|
||||
self, data: QueryDict, files: MultiValueDict, name: str
|
||||
) -> None: ...
|
||||
def format_value(self, value: Optional[List[int]]) -> str: ...
|
||||
|
||||
class RelatedFieldWidgetWrapper(forms.Widget):
|
||||
template_name: str = ...
|
||||
needs_multipart_form: bool = ...
|
||||
attrs: Dict[Any, Any] = ...
|
||||
choices: django.forms.models.ModelChoiceIterator = ...
|
||||
widget: django.contrib.admin.widgets.AutocompleteSelect = ...
|
||||
rel: django.db.models.fields.reverse_related.ManyToOneRel = ...
|
||||
can_add_related: bool = ...
|
||||
can_change_related: bool = ...
|
||||
can_delete_related: bool = ...
|
||||
can_view_related: bool = ...
|
||||
admin_site: django.contrib.admin.sites.AdminSite = ...
|
||||
def __init__(
|
||||
self,
|
||||
widget: ChoiceWidget,
|
||||
rel: ForeignObjectRel,
|
||||
admin_site: AdminSite,
|
||||
can_add_related: Optional[bool] = ...,
|
||||
can_change_related: bool = ...,
|
||||
can_delete_related: bool = ...,
|
||||
can_view_related: bool = ...,
|
||||
) -> None: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Dict[
|
||||
int, Union[List[Union[Field, Widget]], OrderedDict, Field, Widget]
|
||||
],
|
||||
) -> RelatedFieldWidgetWrapper: ...
|
||||
@property
|
||||
def is_hidden(self) -> bool: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def get_related_url(
|
||||
self, info: Tuple[str, str], action: str, *args: Any
|
||||
) -> str: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[int, str]],
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
) -> Dict[str, Union[bool, str]]: ...
|
||||
def value_from_datadict(
|
||||
self, data: QueryDict, files: MultiValueDict, name: str
|
||||
) -> Optional[Union[List[str], str]]: ...
|
||||
def value_omitted_from_data(
|
||||
self, data: Dict[Any, Any], files: Dict[Any, Any], name: str
|
||||
) -> bool: ...
|
||||
def id_for_label(self, id_: str) -> str: ...
|
||||
|
||||
class AdminTextareaWidget(forms.Textarea):
|
||||
attrs: Dict[str, str]
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
|
||||
class AdminTextInputWidget(forms.TextInput):
|
||||
attrs: Dict[str, str]
|
||||
input_type: str
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
|
||||
class AdminEmailInputWidget(forms.EmailInput):
|
||||
attrs: Dict[str, str]
|
||||
input_type: str
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
|
||||
class AdminURLFieldWidget(forms.URLInput):
|
||||
attrs: Dict[str, str]
|
||||
input_type: str
|
||||
template_name: str = ...
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
def get_context(
|
||||
self, name: str, value: Optional[str], attrs: Optional[Dict[str, str]]
|
||||
) -> Dict[
|
||||
str, Union[Dict[str, Optional[Union[Dict[str, str], bool, str]]], str]
|
||||
]: ...
|
||||
|
||||
class AdminIntegerFieldWidget(forms.NumberInput):
|
||||
attrs: Dict[str, str]
|
||||
input_type: str
|
||||
class_name: str = ...
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
|
||||
class AdminBigIntegerFieldWidget(AdminIntegerFieldWidget):
|
||||
class_name: str = ...
|
||||
|
||||
SELECT2_TRANSLATIONS: Any
|
||||
|
||||
class AutocompleteMixin:
|
||||
url_name: str = ...
|
||||
rel: Any = ...
|
||||
admin_site: Any = ...
|
||||
db: Any = ...
|
||||
choices: Any = ...
|
||||
attrs: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
rel: ForeignObjectRel,
|
||||
admin_site: AdminSite,
|
||||
attrs: Optional[Dict[str, str]] = ...,
|
||||
choices: Tuple = ...,
|
||||
using: None = ...,
|
||||
) -> None: ...
|
||||
def get_url(self) -> str: ...
|
||||
def build_attrs(
|
||||
self,
|
||||
base_attrs: Dict[str, str],
|
||||
extra_attrs: Optional[Dict[str, Union[bool, str]]] = ...,
|
||||
) -> Dict[str, Union[bool, str]]: ...
|
||||
def optgroups(
|
||||
self,
|
||||
name: str,
|
||||
value: List[str],
|
||||
attr: Dict[str, Union[bool, str]] = ...,
|
||||
) -> List[
|
||||
Tuple[
|
||||
None,
|
||||
List[Dict[str, Union[Dict[str, bool], Set[str], int, str]]],
|
||||
int,
|
||||
]
|
||||
]: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
|
||||
class AutocompleteSelect(AutocompleteMixin, forms.Select): ...
|
||||
class AutocompleteSelectMultiple(AutocompleteMixin, forms.SelectMultiple): ...
|
||||
16
django-stubs-generated/contrib/admindocs/middleware.pyi
Normal file
16
django-stubs-generated/contrib/admindocs/middleware.pyi
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Any, Callable, Dict, Optional, Tuple
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
|
||||
class XViewMiddleware(MiddlewareMixin):
|
||||
get_response: None
|
||||
def process_view(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
view_func: Callable,
|
||||
view_args: Tuple,
|
||||
view_kwargs: Dict[Any, Any],
|
||||
) -> Optional[HttpResponse]: ...
|
||||
31
django-stubs-generated/contrib/admindocs/utils.pyi
Normal file
31
django-stubs-generated/contrib/admindocs/utils.pyi
Normal file
@@ -0,0 +1,31 @@
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
docutils_is_available: bool
|
||||
|
||||
def get_view_name(view_func: Callable) -> str: ...
|
||||
def trim_docstring(docstring: Any): ...
|
||||
def parse_docstring(docstring: Any): ...
|
||||
def parse_rst(
|
||||
text: Any,
|
||||
default_reference_context: Any,
|
||||
thing_being_parsed: Optional[Any] = ...,
|
||||
): ...
|
||||
|
||||
ROLES: Any
|
||||
|
||||
def create_reference_role(rolename: Any, urlbase: Any): ...
|
||||
def default_reference_role(
|
||||
name: Any,
|
||||
rawtext: Any,
|
||||
text: Any,
|
||||
lineno: Any,
|
||||
inliner: Any,
|
||||
options: Optional[Any] = ...,
|
||||
content: Optional[Any] = ...,
|
||||
): ...
|
||||
|
||||
named_group_matcher: Any
|
||||
unnamed_group_matcher: Any
|
||||
|
||||
def replace_named_groups(pattern: str) -> str: ...
|
||||
def replace_unnamed_groups(pattern: str) -> str: ...
|
||||
52
django-stubs-generated/contrib/admindocs/views.pyi
Normal file
52
django-stubs-generated/contrib/admindocs/views.pyi
Normal file
@@ -0,0 +1,52 @@
|
||||
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
|
||||
|
||||
class BaseAdminDocsView(TemplateView):
|
||||
template_name: str = ...
|
||||
def dispatch(self, request: Any, *args: Any, **kwargs: Any): ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class BookmarkletsView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class TemplateTagIndexView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class TemplateFilterIndexView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class ViewIndexView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class ViewDetailView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class ModelIndexView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class ModelDetailView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class TemplateDetailView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
def get_return_data_type(func_name: Any): ...
|
||||
def get_readable_field_data_type(field: Union[Field, str]) -> str: ...
|
||||
def extract_views_from_urlpatterns(
|
||||
urlpatterns: Any, base: str = ..., namespace: Optional[Any] = ...
|
||||
): ...
|
||||
def simplify_regex(pattern: str) -> str: ...
|
||||
38
django-stubs-generated/contrib/auth/__init__.pyi
Normal file
38
django-stubs-generated/contrib/auth/__init__.pyi
Normal file
@@ -0,0 +1,38 @@
|
||||
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 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 .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) -> ModelBackend: ...
|
||||
def get_backends() -> List[ModelBackend]: ...
|
||||
def authenticate(
|
||||
request: Any = ..., **credentials: Any
|
||||
) -> Optional[AbstractBaseUser]: ...
|
||||
def login(
|
||||
request: HttpRequest,
|
||||
user: AbstractBaseUser,
|
||||
backend: Optional[Union[Type[ModelBackend], str]] = ...,
|
||||
) -> None: ...
|
||||
def logout(request: HttpRequest) -> None: ...
|
||||
def get_user_model() -> Type[Model]: ...
|
||||
def get_user(
|
||||
request: HttpRequest
|
||||
) -> Union[AbstractBaseUser, AnonymousUser]: ...
|
||||
def get_permission_codename(action: str, opts: Options) -> str: ...
|
||||
def update_session_auth_hash(
|
||||
request: WSGIRequest, user: AbstractUser
|
||||
) -> None: ...
|
||||
|
||||
default_app_config: str
|
||||
97
django-stubs-generated/contrib/auth/admin.pyi
Normal file
97
django-stubs-generated/contrib/auth/admin.pyi
Normal file
@@ -0,0 +1,97 @@
|
||||
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 HttpResponse
|
||||
from django.urls.resolvers import URLPattern
|
||||
|
||||
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.DateTimeCheckMixin,
|
||||
django.db.models.fields.Field,
|
||||
]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
Union[
|
||||
django.forms.fields.SplitDateTimeField,
|
||||
django.forms.widgets.Widget,
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
model: Type[django.contrib.auth.models.Group]
|
||||
opts: django.db.models.options.Options
|
||||
search_fields: Any = ...
|
||||
ordering: Any = ...
|
||||
filter_horizontal: Any = ...
|
||||
def formfield_for_manytomany(
|
||||
self,
|
||||
db_field: ManyToManyField,
|
||||
request: WSGIRequest = ...,
|
||||
**kwargs: Any
|
||||
) -> ModelMultipleChoiceField: ...
|
||||
|
||||
class UserAdmin(admin.ModelAdmin):
|
||||
admin_site: django.contrib.admin.sites.AdminSite
|
||||
formfield_overrides: Dict[
|
||||
Type[
|
||||
Union[
|
||||
django.db.models.fields.DateTimeCheckMixin,
|
||||
django.db.models.fields.Field,
|
||||
]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
Union[
|
||||
django.forms.fields.SplitDateTimeField,
|
||||
django.forms.widgets.Widget,
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
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, Tuple[str]]]]: ...
|
||||
def get_form(
|
||||
self, request: Any, obj: Optional[Any] = ..., **kwargs: Any
|
||||
): ...
|
||||
def get_urls(self) -> List[URLPattern]: ...
|
||||
def lookup_allowed(self, lookup: str, value: str) -> bool: ...
|
||||
def add_view(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
form_url: str = ...,
|
||||
extra_context: None = ...,
|
||||
) -> Any: ...
|
||||
def user_change_password(
|
||||
self, request: WSGIRequest, id: str, form_url: str = ...
|
||||
) -> HttpResponse: ...
|
||||
def response_add(
|
||||
self, request: WSGIRequest, obj: User, post_url_continue: None = ...
|
||||
) -> HttpResponse: ...
|
||||
19
django-stubs-generated/contrib/auth/apps.pyi
Normal file
19
django-stubs-generated/contrib/auth/apps.pyi
Normal file
@@ -0,0 +1,19 @@
|
||||
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
|
||||
|
||||
|
||||
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: ...
|
||||
52
django-stubs-generated/contrib/auth/backends.pyi
Normal file
52
django-stubs-generated/contrib/auth/backends.pyi
Normal file
@@ -0,0 +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
|
||||
|
||||
UserModel: Any
|
||||
|
||||
class ModelBackend:
|
||||
def authenticate(
|
||||
self,
|
||||
request: Any,
|
||||
username: Optional[Union[int, str]] = ...,
|
||||
password: Optional[str] = ...,
|
||||
**kwargs: Any
|
||||
) -> Optional[AbstractBaseUser]: ...
|
||||
def user_can_authenticate(
|
||||
self, user: Optional[AbstractBaseUser]
|
||||
) -> bool: ...
|
||||
def get_user_permissions(
|
||||
self, user_obj: AbstractBaseUser, obj: None = ...
|
||||
) -> Set[str]: ...
|
||||
def get_group_permissions(
|
||||
self, user_obj: AbstractBaseUser, obj: None = ...
|
||||
) -> Set[str]: ...
|
||||
def get_all_permissions(
|
||||
self, user_obj: AbstractBaseUser, obj: Optional[str] = ...
|
||||
) -> Set[str]: ...
|
||||
def has_perm(
|
||||
self,
|
||||
user_obj: Union[AbstractBaseUser, AnonymousUser],
|
||||
perm: str,
|
||||
obj: Optional[str] = ...,
|
||||
) -> bool: ...
|
||||
def has_module_perms(
|
||||
self, user_obj: Union[AbstractBaseUser, AnonymousUser], app_label: str
|
||||
) -> bool: ...
|
||||
def get_user(self, user_id: int) -> AbstractBaseUser: ...
|
||||
|
||||
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: ...
|
||||
44
django-stubs-generated/contrib/auth/base_user.pyi
Normal file
44
django-stubs-generated/contrib/auth/base_user.pyi
Normal file
@@ -0,0 +1,44 @@
|
||||
from typing import Any, Optional, Tuple, Union
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
||||
class BaseUserManager(models.Manager):
|
||||
creation_counter: int
|
||||
model: None
|
||||
name: None
|
||||
@classmethod
|
||||
def normalize_email(cls, email: Optional[str]) -> str: ...
|
||||
def make_random_password(
|
||||
self, length: int = ..., allowed_chars: str = ...
|
||||
) -> str: ...
|
||||
def get_by_natural_key(
|
||||
self, username: Optional[str]
|
||||
) -> AbstractBaseUser: ...
|
||||
|
||||
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 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: ...
|
||||
def set_password(self, raw_password: Optional[str]) -> None: ...
|
||||
def check_password(self, raw_password: str) -> bool: ...
|
||||
def set_unusable_password(self) -> None: ...
|
||||
def has_usable_password(self) -> bool: ...
|
||||
def get_session_auth_hash(self) -> str: ...
|
||||
@classmethod
|
||||
def get_email_field_name(cls) -> str: ...
|
||||
@classmethod
|
||||
def normalize_username(
|
||||
cls, username: Union[int, str]
|
||||
) -> Union[int, str]: ...
|
||||
13
django-stubs-generated/contrib/auth/checks.pyi
Normal file
13
django-stubs-generated/contrib/auth/checks.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from django.core.checks.messages import CheckMessage
|
||||
|
||||
from .management import _get_builtin_permissions
|
||||
|
||||
|
||||
def check_user_model(
|
||||
app_configs: None = ..., **kwargs: Any
|
||||
) -> List[CheckMessage]: ...
|
||||
def check_models_permissions(
|
||||
app_configs: None = ..., **kwargs: Any
|
||||
) -> List[Any]: ...
|
||||
25
django-stubs-generated/contrib/auth/context_processors.pyi
Normal file
25
django-stubs-generated/contrib/auth/context_processors.pyi
Normal file
@@ -0,0 +1,25 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.http.request import HttpRequest
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
|
||||
|
||||
class PermLookupDict:
|
||||
app_label: django.utils.safestring.SafeText
|
||||
user: django.utils.functional.SimpleLazyObject
|
||||
def __init__(self, user: SimpleLazyObject, app_label: str) -> None: ...
|
||||
def __getitem__(self, perm_name: str) -> bool: ...
|
||||
def __iter__(self) -> Any: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
|
||||
class PermWrapper:
|
||||
user: django.utils.functional.SimpleLazyObject = ...
|
||||
def __init__(self, user: Union[AnonymousUser, User]) -> None: ...
|
||||
def __getitem__(self, app_label: str) -> PermLookupDict: ...
|
||||
def __iter__(self) -> Any: ...
|
||||
def __contains__(self, perm_name: Union[bool, str]) -> bool: ...
|
||||
|
||||
def auth(
|
||||
request: HttpRequest
|
||||
) -> Dict[str, Union[PermWrapper, AnonymousUser, User]]: ...
|
||||
18
django-stubs-generated/contrib/auth/decorators.pyi
Normal file
18
django-stubs-generated/contrib/auth/decorators.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
from typing import Any, Callable, List, Optional, Set, Union
|
||||
|
||||
|
||||
def user_passes_test(
|
||||
test_func: Callable,
|
||||
login_url: Optional[str] = ...,
|
||||
redirect_field_name: str = ...,
|
||||
) -> Callable: ...
|
||||
def login_required(
|
||||
function: Optional[Callable] = ...,
|
||||
redirect_field_name: str = ...,
|
||||
login_url: Optional[str] = ...,
|
||||
) -> Callable: ...
|
||||
def permission_required(
|
||||
perm: Union[List[str], Set[str], str],
|
||||
login_url: None = ...,
|
||||
raise_exception: bool = ...,
|
||||
) -> Callable: ...
|
||||
190
django-stubs-generated/contrib/auth/forms.pyi
Normal file
190
django-stubs-generated/contrib/auth/forms.pyi
Normal file
@@ -0,0 +1,190 @@
|
||||
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
|
||||
|
||||
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, Optional[Union[Dict[str, str], bool, str]]],
|
||||
List[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 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[List[Any], datetime.datetime, int, str]]]
|
||||
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 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[AbstractBaseUser, str]],
|
||||
from_email: Optional[str],
|
||||
to_email: str,
|
||||
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 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[AbstractBaseUser], *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def clean_new_password2(self) -> str: ...
|
||||
def save(self, commit: bool = ...) -> AbstractBaseUser: ...
|
||||
|
||||
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 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 = ...) -> AbstractUser: ...
|
||||
@property
|
||||
def changed_data(self) -> List[str]: ...
|
||||
8
django-stubs-generated/contrib/auth/handlers/modwsgi.pyi
Normal file
8
django-stubs-generated/contrib/auth/handlers/modwsgi.pyi
Normal file
@@ -0,0 +1,8 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
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: ...
|
||||
115
django-stubs-generated/contrib/auth/hashers.pyi
Normal file
115
django-stubs-generated/contrib/auth/hashers.pyi
Normal file
@@ -0,0 +1,115 @@
|
||||
from collections import OrderedDict
|
||||
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: Optional[str],
|
||||
encoded: str,
|
||||
setter: Optional[Callable] = ...,
|
||||
preferred: str = ...,
|
||||
) -> bool: ...
|
||||
def make_password(
|
||||
password: Optional[str], salt: Optional[str] = ..., hasher: str = ...
|
||||
) -> str: ...
|
||||
def get_hashers() -> List[BasePasswordHasher]: ...
|
||||
def get_hashers_by_algorithm() -> Dict[str, BasePasswordHasher]: ...
|
||||
def reset_hashers(**kwargs: Any) -> None: ...
|
||||
def get_hasher(algorithm: str = ...) -> BasePasswordHasher: ...
|
||||
def identify_hasher(encoded: str) -> BasePasswordHasher: ...
|
||||
def mask_hash(hash: str, show: int = ..., char: str = ...) -> str: ...
|
||||
|
||||
class BasePasswordHasher:
|
||||
algorithm: Any = ...
|
||||
library: Any = ...
|
||||
def salt(self) -> str: ...
|
||||
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: ...
|
||||
|
||||
class PBKDF2PasswordHasher(BasePasswordHasher):
|
||||
algorithm: str = ...
|
||||
iterations: int = ...
|
||||
digest: Any = ...
|
||||
def encode(
|
||||
self, password: str, salt: str, iterations: Optional[int] = ...
|
||||
) -> str: ...
|
||||
def verify(self, password: str, encoded: str) -> bool: ...
|
||||
def safe_summary(self, encoded: str) -> OrderedDict: ...
|
||||
def must_update(self, encoded: str) -> bool: ...
|
||||
def harden_runtime(self, password: str, encoded: str) -> None: ...
|
||||
|
||||
class PBKDF2SHA1PasswordHasher(PBKDF2PasswordHasher):
|
||||
algorithm: str = ...
|
||||
digest: Any = ...
|
||||
|
||||
class Argon2PasswordHasher(BasePasswordHasher):
|
||||
algorithm: str = ...
|
||||
library: str = ...
|
||||
time_cost: int = ...
|
||||
memory_cost: int = ...
|
||||
parallelism: int = ...
|
||||
def encode(self, password: Any, salt: Any): ...
|
||||
def verify(self, password: Any, encoded: Any): ...
|
||||
def safe_summary(self, encoded: Any): ...
|
||||
def must_update(self, encoded: Any): ...
|
||||
def harden_runtime(self, password: Any, encoded: Any) -> None: ...
|
||||
|
||||
class BCryptSHA256PasswordHasher(BasePasswordHasher):
|
||||
algorithm: str = ...
|
||||
digest: Any = ...
|
||||
library: Any = ...
|
||||
rounds: int = ...
|
||||
def salt(self): ...
|
||||
def encode(self, password: Any, salt: Any): ...
|
||||
def verify(self, password: Any, encoded: Any): ...
|
||||
def safe_summary(self, encoded: Any): ...
|
||||
def must_update(self, encoded: Any): ...
|
||||
def harden_runtime(self, password: Any, encoded: Any) -> None: ...
|
||||
|
||||
class BCryptPasswordHasher(BCryptSHA256PasswordHasher):
|
||||
algorithm: str = ...
|
||||
digest: Any = ...
|
||||
|
||||
class SHA1PasswordHasher(BasePasswordHasher):
|
||||
algorithm: str = ...
|
||||
def encode(self, password: str, salt: str) -> str: ...
|
||||
def verify(self, password: str, encoded: str) -> bool: ...
|
||||
def safe_summary(self, encoded: Any): ...
|
||||
def harden_runtime(self, password: Any, encoded: Any) -> None: ...
|
||||
|
||||
class MD5PasswordHasher(BasePasswordHasher):
|
||||
algorithm: str = ...
|
||||
def encode(self, password: str, salt: str) -> str: ...
|
||||
def verify(self, password: str, encoded: str) -> bool: ...
|
||||
def safe_summary(self, encoded: str) -> OrderedDict: ...
|
||||
def harden_runtime(self, password: Any, encoded: Any) -> None: ...
|
||||
|
||||
class UnsaltedSHA1PasswordHasher(BasePasswordHasher):
|
||||
algorithm: str = ...
|
||||
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): ...
|
||||
def harden_runtime(self, password: Any, encoded: Any) -> None: ...
|
||||
|
||||
class UnsaltedMD5PasswordHasher(BasePasswordHasher):
|
||||
algorithm: str = ...
|
||||
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): ...
|
||||
def harden_runtime(self, password: Any, encoded: Any) -> None: ...
|
||||
|
||||
class CryptPasswordHasher(BasePasswordHasher):
|
||||
algorithm: str = ...
|
||||
library: str = ...
|
||||
def salt(self): ...
|
||||
def encode(self, password: Any, salt: Any): ...
|
||||
def verify(self, password: Any, encoded: Any): ...
|
||||
def safe_summary(self, encoded: Any): ...
|
||||
def harden_runtime(self, password: Any, encoded: Any) -> None: ...
|
||||
16
django-stubs-generated/contrib/auth/management/__init__.pyi
Normal file
16
django-stubs-generated/contrib/auth/management/__init__.pyi
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
from django.apps.registry import Apps
|
||||
|
||||
|
||||
def create_permissions(
|
||||
app_config: AppConfig,
|
||||
verbosity: int = ...,
|
||||
interactive: bool = ...,
|
||||
using: str = ...,
|
||||
apps: Apps = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def get_system_username() -> str: ...
|
||||
def get_default_username(check_db: bool = ...) -> str: ...
|
||||
@@ -0,0 +1,15 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
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: Any, **options: Any) -> str: ...
|
||||
@@ -0,0 +1,25 @@
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
from django.core.management.base import BaseCommand, CommandParser
|
||||
from django.db.models.fields import Field
|
||||
|
||||
|
||||
class NotRunningInTTYException(Exception): ...
|
||||
|
||||
class Command(BaseCommand):
|
||||
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: ...
|
||||
stdin: Any = ...
|
||||
def execute(self, *args: Any, **options: Any) -> None: ...
|
||||
def handle(self, *args: Any, **options: Any) -> None: ...
|
||||
def get_input_data(
|
||||
self, field: Field, message: str, default: Optional[str] = ...
|
||||
) -> Optional[Union[int, str]]: ...
|
||||
24
django-stubs-generated/contrib/auth/middleware.pyi
Normal file
24
django-stubs-generated/contrib/auth/middleware.pyi
Normal file
@@ -0,0 +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 django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
|
||||
def get_user(request: WSGIRequest) -> Union[AnonymousUser, User]: ...
|
||||
|
||||
class AuthenticationMiddleware(MiddlewareMixin):
|
||||
get_response: Callable
|
||||
def process_request(self, request: HttpRequest) -> None: ...
|
||||
|
||||
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 = ...
|
||||
35
django-stubs-generated/contrib/auth/mixins.pyi
Normal file
35
django-stubs-generated/contrib/auth/mixins.pyi
Normal file
@@ -0,0 +1,35 @@
|
||||
from typing import Any, Callable, List, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||
|
||||
|
||||
class AccessMixin:
|
||||
login_url: Any = ...
|
||||
permission_denied_message: str = ...
|
||||
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) -> HttpResponseRedirect: ...
|
||||
|
||||
class LoginRequiredMixin(AccessMixin):
|
||||
def dispatch(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
|
||||
class PermissionRequiredMixin(AccessMixin):
|
||||
permission_required: Any = ...
|
||||
def get_permission_required(self) -> List[str]: ...
|
||||
def has_permission(self) -> bool: ...
|
||||
def dispatch(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
|
||||
class UserPassesTestMixin(AccessMixin):
|
||||
def test_func(self) -> None: ...
|
||||
def get_test_func(self) -> Callable: ...
|
||||
def dispatch(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
160
django-stubs-generated/contrib/auth/models.pyi
Normal file
160
django-stubs-generated/contrib/auth/models.pyi
Normal file
@@ -0,0 +1,160 @@
|
||||
from typing import Any, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
|
||||
from django.db import models
|
||||
from django.db.models.manager import EmptyManager
|
||||
|
||||
from .validators import UnicodeUsernameValidator
|
||||
|
||||
|
||||
def update_last_login(
|
||||
sender: Type[AbstractBaseUser], user: AbstractBaseUser, **kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
class PermissionManager(models.Manager):
|
||||
creation_counter: int
|
||||
model: None
|
||||
name: None
|
||||
use_in_migrations: bool = ...
|
||||
def get_by_natural_key(
|
||||
self, codename: str, app_label: str, model: str
|
||||
) -> Permission: ...
|
||||
|
||||
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 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: 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[Tuple[str, Any], str], obj: Optional[str] = ...
|
||||
) -> bool: ...
|
||||
def has_perms(
|
||||
self, perm_list: Union[List[str], Set[str], Tuple[str]], obj: None = ...
|
||||
) -> bool: ...
|
||||
def has_module_perms(self, app_label: str) -> bool: ...
|
||||
|
||||
class AbstractUser(AbstractBaseUser, PermissionsMixin):
|
||||
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: ...
|
||||
63
django-stubs-generated/contrib/auth/password_validation.pyi
Normal file
63
django-stubs-generated/contrib/auth/password_validation.pyi
Normal file
@@ -0,0 +1,63 @@
|
||||
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
|
||||
|
||||
|
||||
def get_default_password_validators() -> Union[
|
||||
List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]
|
||||
]: ...
|
||||
def get_password_validators(
|
||||
validator_config: List[Dict[str, Union[Dict[str, int], str]]]
|
||||
) -> Union[
|
||||
List[NumericPasswordValidator], List[UserAttributeSimilarityValidator]
|
||||
]: ...
|
||||
def validate_password(
|
||||
password: str,
|
||||
user: Optional[AbstractBaseUser] = ...,
|
||||
password_validators: Optional[List[Any]] = ...,
|
||||
) -> None: ...
|
||||
def password_changed(
|
||||
password: str,
|
||||
user: Optional[AbstractBaseUser] = ...,
|
||||
password_validators: None = ...,
|
||||
) -> None: ...
|
||||
def password_validators_help_texts(
|
||||
password_validators: Optional[List[Any]] = ...
|
||||
) -> List[str]: ...
|
||||
|
||||
password_validators_help_text_html: Any
|
||||
|
||||
class MinimumLengthValidator:
|
||||
min_length: int = ...
|
||||
def __init__(self, min_length: int = ...) -> None: ...
|
||||
def validate(self, password: str, user: Optional[User] = ...) -> None: ...
|
||||
def get_help_text(self) -> str: ...
|
||||
|
||||
class UserAttributeSimilarityValidator:
|
||||
DEFAULT_USER_ATTRIBUTES: Any = ...
|
||||
user_attributes: Tuple[str, str, str, str] = ...
|
||||
max_similarity: float = ...
|
||||
def __init__(
|
||||
self,
|
||||
user_attributes: Union[List[str], Tuple[str, str, str, str]] = ...,
|
||||
max_similarity: float = ...,
|
||||
) -> None: ...
|
||||
def validate(self, password: str, user: Optional[User] = ...) -> None: ...
|
||||
def get_help_text(self) -> str: ...
|
||||
|
||||
class CommonPasswordValidator:
|
||||
DEFAULT_PASSWORD_LIST_PATH: Any = ...
|
||||
passwords: Set[str] = ...
|
||||
def __init__(
|
||||
self, password_list_path: Union[PosixPath, str] = ...
|
||||
) -> None: ...
|
||||
def validate(self, password: str, user: None = ...) -> None: ...
|
||||
def get_help_text(self) -> str: ...
|
||||
|
||||
class NumericPasswordValidator:
|
||||
def validate(
|
||||
self, password: str, user: Optional[AbstractBaseUser] = ...
|
||||
) -> None: ...
|
||||
def get_help_text(self) -> str: ...
|
||||
14
django-stubs-generated/contrib/auth/tokens.pyi
Normal file
14
django-stubs-generated/contrib/auth/tokens.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
|
||||
|
||||
class PasswordResetTokenGenerator:
|
||||
key_salt: str = ...
|
||||
secret: Any = ...
|
||||
def make_token(self, user: AbstractBaseUser) -> str: ...
|
||||
def check_token(
|
||||
self, user: Optional[AbstractBaseUser], token: Optional[str]
|
||||
) -> bool: ...
|
||||
|
||||
default_token_generator: Any
|
||||
135
django-stubs-generated/contrib/auth/views.pyi
Normal file
135
django-stubs-generated/contrib/auth/views.pyi
Normal file
@@ -0,0 +1,135 @@
|
||||
from typing import Any, Dict, Optional, Set, Type, Union
|
||||
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.contrib.auth.forms import (AuthenticationForm, PasswordChangeForm,
|
||||
PasswordResetForm, SetPasswordForm)
|
||||
from django.contrib.auth.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.views.generic.base import TemplateView
|
||||
from django.views.generic.edit import FormView
|
||||
|
||||
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: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
def get_redirect_url(self) -> str: ...
|
||||
def get_form_class(self) -> Type[AuthenticationForm]: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[
|
||||
str, Optional[Union[Dict[str, str], HttpRequest, MultiValueDict]]
|
||||
]: ...
|
||||
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
||||
def get_context_data(
|
||||
self, **kwargs: Any
|
||||
) -> Dict[
|
||||
str, Union[AuthenticationForm, LoginView, Site, RequestSite, str]
|
||||
]: ...
|
||||
|
||||
class LogoutView(SuccessURLAllowedHostsMixin, TemplateView):
|
||||
next_page: Any = ...
|
||||
redirect_field_name: Any = ...
|
||||
template_name: str = ...
|
||||
extra_context: Any = ...
|
||||
def dispatch(
|
||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
def post(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> TemplateResponse: ...
|
||||
def get_next_page(self) -> Optional[str]: ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
def logout_then_login(
|
||||
request: HttpRequest, login_url: Optional[str] = ...
|
||||
) -> HttpResponseRedirect: ...
|
||||
def redirect_to_login(
|
||||
next: str,
|
||||
login_url: Optional[str] = ...,
|
||||
redirect_field_name: Optional[str] = ...,
|
||||
) -> HttpResponseRedirect: ...
|
||||
|
||||
class PasswordContextMixin:
|
||||
extra_context: Any = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
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: ...
|
||||
|
||||
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], AbstractBaseUser, MultiValueDict]]
|
||||
]: ...
|
||||
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]]]: ...
|
||||
def form_valid(self, form: PasswordChangeForm) -> HttpResponseRedirect: ...
|
||||
|
||||
class PasswordChangeDoneView(PasswordContextMixin, TemplateView):
|
||||
template_name: str = ...
|
||||
title: Any = ...
|
||||
def dispatch(self, *args: Any, **kwargs: Any) -> TemplateResponse: ...
|
||||
10
django-stubs-generated/contrib/contenttypes/admin.pyi
Normal file
10
django-stubs-generated/contrib/contenttypes/admin.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from django.db.models.base import Model
|
||||
from typing import Any, List, Type
|
||||
|
||||
class GenericInlineModelAdminChecks:
|
||||
def _check_exclude_of_parent_model(
|
||||
self, obj: GenericTabularInline, parent_model: Type[Model]
|
||||
) -> List[Any]: ...
|
||||
def _check_relation(
|
||||
self, obj: GenericTabularInline, parent_model: Type[Model]
|
||||
) -> List[Any]: ...
|
||||
18
django-stubs-generated/contrib/contenttypes/apps.pyi
Normal file
18
django-stubs-generated/contrib/contenttypes/apps.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
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: ...
|
||||
9
django-stubs-generated/contrib/contenttypes/checks.pyi
Normal file
9
django-stubs-generated/contrib/contenttypes/checks.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import Any, List, Optional
|
||||
|
||||
|
||||
def check_generic_foreign_keys(
|
||||
app_configs: None = ..., **kwargs: Any
|
||||
) -> List[Any]: ...
|
||||
def check_model_name_lengths(
|
||||
app_configs: None = ..., **kwargs: Any
|
||||
) -> List[Any]: ...
|
||||
139
django-stubs-generated/contrib/contenttypes/fields.pyi
Normal file
139
django-stubs-generated/contrib/contenttypes/fields.pyi
Normal file
@@ -0,0 +1,139 @@
|
||||
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 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
|
||||
|
||||
|
||||
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 = ...,
|
||||
) -> None: ...
|
||||
name: Any = ...
|
||||
model: Any = ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> None: ...
|
||||
def get_filter_kwargs_for_object(
|
||||
self, obj: Model
|
||||
) -> Dict[str, Optional[ContentType]]: ...
|
||||
def get_forward_related_filter(self, obj: Model) -> Dict[str, int]: ...
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
def get_cache_name(self) -> str: ...
|
||||
def get_content_type(
|
||||
self,
|
||||
obj: Optional[Model] = ...,
|
||||
id: Optional[int] = ...,
|
||||
using: Optional[str] = ...,
|
||||
) -> ContentType: ...
|
||||
def get_prefetch_queryset(
|
||||
self,
|
||||
instances: Union[List[Model], QuerySet],
|
||||
queryset: Optional[QuerySet] = ...,
|
||||
) -> Tuple[List[Model], Callable, Callable, bool, str, bool]: ...
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Optional[Union[GenericForeignKey, Model]]: ...
|
||||
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
|
||||
|
||||
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,
|
||||
to: Union[Type[Model], str],
|
||||
related_name: None = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: None = ...,
|
||||
) -> None: ...
|
||||
|
||||
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],
|
||||
object_id_field: str = ...,
|
||||
content_type_field: str = ...,
|
||||
for_concrete_model: bool = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: None = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
to_fields: Any = ...
|
||||
def resolve_related_fields(
|
||||
self
|
||||
) -> List[Tuple[PositiveIntegerField, Field]]: ...
|
||||
def get_path_info(
|
||||
self, filtered_relation: Optional[FilteredRelation] = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def get_reverse_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def 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): ...
|
||||
42
django-stubs-generated/contrib/contenttypes/forms.pyi
Normal file
42
django-stubs-generated/contrib/contenttypes/forms.pyi
Normal file
@@ -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 = ...,
|
||||
): ...
|
||||
@@ -0,0 +1,43 @@
|
||||
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 django.db.models.base import Model
|
||||
|
||||
|
||||
class RenameContentType(migrations.RunPython):
|
||||
app_label: Any = ...
|
||||
old_model: Any = ...
|
||||
new_model: Any = ...
|
||||
def __init__(
|
||||
self, app_label: str, old_model: str, new_model: str
|
||||
) -> None: ...
|
||||
def rename_forward(
|
||||
self, apps: StateApps, schema_editor: DatabaseSchemaEditor
|
||||
) -> None: ...
|
||||
def rename_backward(
|
||||
self, apps: StateApps, schema_editor: DatabaseSchemaEditor
|
||||
) -> None: ...
|
||||
|
||||
def inject_rename_contenttypes_operations(
|
||||
plan: List[Tuple[Migration, bool]] = ...,
|
||||
apps: StateApps = ...,
|
||||
using: str = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def get_contenttypes_and_models(
|
||||
app_config: AppConfig, using: str, ContentType: Type[ContentType]
|
||||
) -> Tuple[Dict[str, ContentType], Dict[str, Type[Model]]]: ...
|
||||
def create_contenttypes(
|
||||
app_config: AppConfig,
|
||||
verbosity: int = ...,
|
||||
interactive: bool = ...,
|
||||
using: str = ...,
|
||||
apps: Apps = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
@@ -0,0 +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
|
||||
|
||||
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: Any) -> None: ...
|
||||
|
||||
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: ...
|
||||
39
django-stubs-generated/contrib/contenttypes/models.pyi
Normal file
39
django-stubs-generated/contrib/contenttypes/models.pyi
Normal file
@@ -0,0 +1,39 @@
|
||||
from typing import Any, Dict, Optional, Tuple, Type, Union
|
||||
|
||||
from django.db import models
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
|
||||
class ContentTypeManager(models.Manager):
|
||||
creation_counter: int
|
||||
model: None
|
||||
name: None
|
||||
use_in_migrations: bool = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def get_by_natural_key(self, app_label: str, model: str) -> ContentType: ...
|
||||
def get_for_model(
|
||||
self, model: Union[Type[Model], Model], for_concrete_model: bool = ...
|
||||
) -> ContentType: ...
|
||||
def get_for_models(
|
||||
self, *models: Any, for_concrete_models: bool = ...
|
||||
) -> Dict[Type[Model], ContentType]: ...
|
||||
def get_for_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 model_class(self) -> Optional[Type[Model]]: ...
|
||||
def get_object_for_this_type(self, **kwargs: Any) -> Model: ...
|
||||
def get_all_objects_for_this_type(self, **kwargs: Any) -> QuerySet: ...
|
||||
def natural_key(self) -> Tuple[str, str]: ...
|
||||
11
django-stubs-generated/contrib/contenttypes/views.pyi
Normal file
11
django-stubs-generated/contrib/contenttypes/views.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseRedirect
|
||||
|
||||
|
||||
def shortcut(
|
||||
request: HttpRequest,
|
||||
content_type_id: Union[int, str],
|
||||
object_id: Union[int, str],
|
||||
) -> HttpResponseRedirect: ...
|
||||
23
django-stubs-generated/contrib/flatpages/forms.pyi
Normal file
23
django-stubs-generated/contrib/flatpages/forms.pyi
Normal file
@@ -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[List[int], str]]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[str, Union[List[django.contrib.sites.models.Site], int, str]]
|
||||
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[bool, QuerySet, str]]: ...
|
||||
12
django-stubs-generated/contrib/flatpages/middleware.pyi
Normal file
12
django-stubs-generated/contrib/flatpages/middleware.pyi
Normal file
@@ -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: ...
|
||||
20
django-stubs-generated/contrib/flatpages/models.pyi
Normal file
20
django-stubs-generated/contrib/flatpages/models.pyi
Normal file
@@ -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: ...
|
||||
8
django-stubs-generated/contrib/flatpages/sitemaps.pyi
Normal file
8
django-stubs-generated/contrib/flatpages/sitemaps.pyi
Normal file
@@ -0,0 +1,8 @@
|
||||
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: ...
|
||||
10
django-stubs-generated/contrib/flatpages/views.pyi
Normal file
10
django-stubs-generated/contrib/flatpages/views.pyi
Normal file
@@ -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: ...
|
||||
@@ -0,0 +1,19 @@
|
||||
from datetime import date, datetime
|
||||
from decimal import Decimal
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
register: Any
|
||||
|
||||
def ordinal(value: Optional[str]) -> Optional[str]: ...
|
||||
def intcomma(
|
||||
value: Optional[Union[Decimal, float, str]], use_l10n: bool = ...
|
||||
) -> str: ...
|
||||
|
||||
intword_converters: Any
|
||||
|
||||
def intword(value: Optional[str]) -> Optional[Union[int, str]]: ...
|
||||
def apnumber(value: Optional[str]) -> Optional[Union[int, str]]: ...
|
||||
def naturalday(
|
||||
value: Optional[Union[date, str]], arg: None = ...
|
||||
) -> Optional[str]: ...
|
||||
def naturaltime(value: datetime) -> str: ...
|
||||
49
django-stubs-generated/contrib/messages/api.pyi
Normal file
49
django-stubs-generated/contrib/messages/api.pyi
Normal file
@@ -0,0 +1,49 @@
|
||||
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
|
||||
|
||||
|
||||
class MessageFailure(Exception): ...
|
||||
|
||||
def add_message(
|
||||
request: Optional[WSGIRequest],
|
||||
level: int,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: Union[bool, str] = ...,
|
||||
) -> None: ...
|
||||
def get_messages(request: HttpRequest) -> Union[List[Any], BaseStorage]: ...
|
||||
def get_level(request: HttpRequest) -> int: ...
|
||||
def set_level(request: HttpRequest, level: int) -> bool: ...
|
||||
def debug(
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: Union[bool, str] = ...,
|
||||
) -> None: ...
|
||||
def info(
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: Union[bool, str] = ...,
|
||||
) -> None: ...
|
||||
def success(
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: Union[bool, str] = ...,
|
||||
) -> None: ...
|
||||
def warning(
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: Union[bool, str] = ...,
|
||||
) -> None: ...
|
||||
def error(
|
||||
request: WSGIRequest,
|
||||
message: str,
|
||||
extra_tags: str = ...,
|
||||
fail_silently: Union[bool, str] = ...,
|
||||
) -> None: ...
|
||||
@@ -0,0 +1,9 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
from django.http.request import HttpRequest
|
||||
|
||||
|
||||
def messages(
|
||||
request: HttpRequest
|
||||
) -> Dict[str, Union[Dict[str, int], List[Any], BaseStorage]]: ...
|
||||
14
django-stubs-generated/contrib/messages/middleware.pyi
Normal file
14
django-stubs-generated/contrib/messages/middleware.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
||||
) -> HttpResponseBase: ...
|
||||
@@ -0,0 +1,7 @@
|
||||
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: ...
|
||||
35
django-stubs-generated/contrib/messages/storage/base.pyi
Normal file
35
django-stubs-generated/contrib/messages/storage/base.pyi
Normal file
@@ -0,0 +1,35 @@
|
||||
from typing import Any, List, Optional, Union
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseBase
|
||||
|
||||
LEVEL_TAGS: Any
|
||||
|
||||
class Message:
|
||||
level: int = ...
|
||||
message: str = ...
|
||||
extra_tags: str = ...
|
||||
def __init__(
|
||||
self, level: int, message: str, extra_tags: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def __eq__(self, other: Union[Message, str]) -> bool: ...
|
||||
@property
|
||||
def tags(self) -> str: ...
|
||||
@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 = ...
|
||||
75
django-stubs-generated/contrib/messages/storage/cookie.pyi
Normal file
75
django-stubs-generated/contrib/messages/storage/cookie.pyi
Normal file
@@ -0,0 +1,75 @@
|
||||
import json
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage, Message
|
||||
|
||||
|
||||
class MessageEncoder(json.JSONEncoder):
|
||||
allow_nan: bool
|
||||
check_circular: bool
|
||||
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]]: ...
|
||||
|
||||
class MessageDecoder(json.JSONDecoder):
|
||||
def process_messages(
|
||||
self,
|
||||
obj: Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[
|
||||
Union[
|
||||
Dict[str, List[Union[int, str]]],
|
||||
List[Union[int, str]],
|
||||
]
|
||||
],
|
||||
List[Union[int, str]],
|
||||
],
|
||||
],
|
||||
List[Union[List[Union[int, str]], str]],
|
||||
str,
|
||||
],
|
||||
) -> Union[
|
||||
Dict[str, Union[List[Union[Dict[str, Message], Message]], Message]],
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[List[Union[Dict[str, Message], Message]], Message],
|
||||
],
|
||||
Message,
|
||||
]
|
||||
],
|
||||
List[Union[Message, str]],
|
||||
Message,
|
||||
str,
|
||||
]: ...
|
||||
def decode(
|
||||
self, s: str, **kwargs: Any
|
||||
) -> Union[
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[List[Union[Dict[str, Message], Message]], Message],
|
||||
],
|
||||
Message,
|
||||
]
|
||||
],
|
||||
List[Union[Message, str]],
|
||||
Message,
|
||||
]: ...
|
||||
|
||||
class CookieStorage(BaseStorage):
|
||||
added_new: bool
|
||||
request: django.core.handlers.wsgi.WSGIRequest
|
||||
used: bool
|
||||
cookie_name: str = ...
|
||||
max_cookie_size: int = ...
|
||||
not_finished: str = ...
|
||||
12
django-stubs-generated/contrib/messages/storage/fallback.pyi
Normal file
12
django-stubs-generated/contrib/messages/storage/fallback.pyi
Normal file
@@ -0,0 +1,12 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
|
||||
|
||||
class FallbackStorage(BaseStorage):
|
||||
added_new: bool
|
||||
request: django.core.handlers.wsgi.WSGIRequest
|
||||
used: bool
|
||||
storage_classes: Any = ...
|
||||
storages: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
20
django-stubs-generated/contrib/messages/storage/session.pyi
Normal file
20
django-stubs-generated/contrib/messages/storage/session.pyi
Normal file
@@ -0,0 +1,20 @@
|
||||
from typing import Any, List, Optional, Union
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage, Message
|
||||
from django.http.request import HttpRequest
|
||||
|
||||
|
||||
class SessionStorage(BaseStorage):
|
||||
added_new: bool
|
||||
request: django.core.handlers.wsgi.WSGIRequest
|
||||
used: bool
|
||||
session_key: str = ...
|
||||
def __init__(
|
||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def serialize_messages(
|
||||
self, messages: Union[List[Message], List[str]]
|
||||
) -> str: ...
|
||||
def deserialize_messages(
|
||||
self, data: Optional[Union[List[Any], str]]
|
||||
) -> Optional[Union[List[Message], List[str]]]: ...
|
||||
4
django-stubs-generated/contrib/messages/utils.pyi
Normal file
4
django-stubs-generated/contrib/messages/utils.pyi
Normal file
@@ -0,0 +1,4 @@
|
||||
from typing import Dict, Optional
|
||||
|
||||
|
||||
def get_level_tags() -> Dict[int, str]: ...
|
||||
10
django-stubs-generated/contrib/messages/views.pyi
Normal file
10
django-stubs-generated/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: ...
|
||||
@@ -0,0 +1,3 @@
|
||||
from .array import * # NOQA
|
||||
from .jsonb import * # NOQA
|
||||
from .ranges import * # NOQA
|
||||
97
django-stubs-generated/contrib/postgres/fields/array.pyi
Normal file
97
django-stubs-generated/contrib/postgres/fields/array.pyi
Normal file
@@ -0,0 +1,97 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union, TypeVar, Type, Generic
|
||||
|
||||
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
|
||||
|
||||
_T = TypeVar('_T', bound=Field)
|
||||
|
||||
|
||||
class ArrayField(CheckFieldDefaultMixin, Field, Generic[_T]):
|
||||
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: _T, 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, Optional[Union[bool, Field]]]
|
||||
]: ...
|
||||
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): ...
|
||||
def __get__(self, instance, owner) -> List[_T]: ...
|
||||
|
||||
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-generated/contrib/postgres/fields/jsonb.pyi
Normal file
89
django-stubs-generated/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[Type[DjangoJSONEncoder], bool]]
|
||||
]: ...
|
||||
def get_transform(self, name: Any): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def validate(self, value: Any, model_instance: Any) -> None: ...
|
||||
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): ...
|
||||
@@ -0,0 +1,5 @@
|
||||
from typing import Any, List, Optional
|
||||
|
||||
|
||||
class CheckFieldDefaultMixin:
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
98
django-stubs-generated/contrib/postgres/fields/ranges.pyi
Normal file
98
django-stubs-generated/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-generated/contrib/postgres/operations.pyi
Normal file
51
django-stubs-generated/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: ...
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user