mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-16 16:57:12 +08:00
* Better linting config * Applies isort on django-stubs, only style changes * Fixes black and isort compat
25 lines
1.0 KiB
Python
25 lines
1.0 KiB
Python
# Stubs for django.conf.urls (Python 3.5)
|
|
from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Union, overload
|
|
|
|
from django.http.response import HttpResponse, HttpResponseBase
|
|
from django.urls import URLPattern, URLResolver
|
|
|
|
handler400: Union[str, Callable[..., HttpResponse]] = ...
|
|
handler403: Union[str, Callable[..., HttpResponse]] = ...
|
|
handler404: Union[str, Callable[..., HttpResponse]] = ...
|
|
handler500: Union[str, Callable[..., HttpResponse]] = ...
|
|
|
|
IncludedURLConf = Tuple[Sequence[Union[URLResolver, URLPattern]], Optional[str], Optional[str]]
|
|
|
|
def include(arg: Any, namespace: str = ..., app_name: str = ...) -> IncludedURLConf: ...
|
|
@overload
|
|
def url(
|
|
regex: str, view: Callable[..., HttpResponseBase], kwargs: Dict[str, Any] = ..., name: str = ...
|
|
) -> URLPattern: ...
|
|
@overload
|
|
def url(regex: str, view: IncludedURLConf, kwargs: Dict[str, Any] = ..., name: str = ...) -> URLResolver: ...
|
|
@overload
|
|
def url(
|
|
regex: str, view: Sequence[Union[URLResolver, str]], kwargs: Dict[str, Any] = ..., name: str = ...
|
|
) -> URLResolver: ...
|