mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-17 17:35:59 +08:00
move generated stubs to separate directory, too messty
This commit is contained in:
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): ...
|
||||
Reference in New Issue
Block a user