mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-02-16 23:13:56 +08:00
79 lines
2.4 KiB
Python
79 lines
2.4 KiB
Python
from django.core.handlers.wsgi import WSGIRequest
|
|
from django.db.models.base import Model
|
|
from django.http.response import (
|
|
HttpResponse,
|
|
HttpResponseRedirect,
|
|
)
|
|
from django.template.response import TemplateResponse
|
|
from django.urls.resolvers import (
|
|
URLPattern,
|
|
URLResolver,
|
|
)
|
|
from typing import (
|
|
Any,
|
|
Callable,
|
|
Dict,
|
|
List,
|
|
Tuple,
|
|
Type,
|
|
Union,
|
|
)
|
|
|
|
|
|
class AdminSite:
|
|
def __init__(self, name: str = ...) -> None: ...
|
|
def _build_app_dict(self, request: WSGIRequest, label: None = ...) -> Dict[Any, Any]: ...
|
|
def add_action(self, action: Callable, name: None = ...) -> None: ...
|
|
def admin_view(self, view: Callable, cacheable: bool = ...) -> Callable: ...
|
|
def app_index(
|
|
self,
|
|
request: WSGIRequest,
|
|
app_label: str,
|
|
extra_context: None = ...
|
|
) -> TemplateResponse: ...
|
|
def check(self, app_configs: None) -> List[Any]: ...
|
|
def get_action(self, name: str) -> Callable: ...
|
|
def get_app_list(self, request: WSGIRequest) -> List[Any]: ...
|
|
def get_urls(self) -> List[Union[URLPattern, URLResolver]]: ...
|
|
def has_permission(self, request: WSGIRequest) -> bool: ...
|
|
def i18n_javascript(
|
|
self,
|
|
request: WSGIRequest,
|
|
extra_context: None = ...
|
|
) -> HttpResponse: ...
|
|
def index(
|
|
self,
|
|
request: WSGIRequest,
|
|
extra_context: None = ...
|
|
) -> TemplateResponse: ...
|
|
def is_registered(self, model: Type[Model]) -> bool: ...
|
|
def login(
|
|
self,
|
|
request: WSGIRequest,
|
|
extra_context: None = ...
|
|
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
|
def logout(
|
|
self,
|
|
request: WSGIRequest,
|
|
extra_context: None = ...
|
|
) -> TemplateResponse: ...
|
|
def password_change(
|
|
self,
|
|
request: WSGIRequest,
|
|
extra_context: Dict[str, str] = ...
|
|
) -> TemplateResponse: ...
|
|
def password_change_done(
|
|
self,
|
|
request: WSGIRequest,
|
|
extra_context: None = ...
|
|
) -> TemplateResponse: ...
|
|
def register(self, model_or_iterable: Any, admin_class: Any = ..., **options) -> None: ...
|
|
def unregister(self, model_or_iterable: Type[Model]) -> None: ...
|
|
@property
|
|
def urls(
|
|
self
|
|
) -> Union[Tuple[List[URLPattern], str, str], Tuple[List[Union[URLPattern, URLResolver]], str, str]]: ...
|
|
|
|
|
|
class DefaultAdminSite:
|
|
def _setup(self) -> None: ... |