mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 21:14:49 +08:00
move django.urls completely
This commit is contained in:
@@ -8,7 +8,6 @@ from django.core.mail.message import EmailMultiAlternatives as EmailMultiAlterna
|
|||||||
from django.core.mail.message import SafeMIMEMultipart as SafeMIMEMultipart
|
from django.core.mail.message import SafeMIMEMultipart as SafeMIMEMultipart
|
||||||
from django.core.mail.message import SafeMIMEText as SafeMIMEText
|
from django.core.mail.message import SafeMIMEText as SafeMIMEText
|
||||||
from django.core.mail.message import forbid_multi_line_headers as forbid_multi_line_headers
|
from django.core.mail.message import forbid_multi_line_headers as forbid_multi_line_headers
|
||||||
from django.core.mail.message import make_msgid as make_msgid
|
|
||||||
from django.core.mail.utils import DNS_NAME as DNS_NAME
|
from django.core.mail.utils import DNS_NAME as DNS_NAME
|
||||||
from django.core.mail.utils import CachedDnsName as CachedDnsName
|
from django.core.mail.utils import CachedDnsName as CachedDnsName
|
||||||
|
|
||||||
@@ -45,3 +44,5 @@ def mail_managers(
|
|||||||
connection: Optional[BaseEmailBackend] = ...,
|
connection: Optional[BaseEmailBackend] = ...,
|
||||||
html_message: Optional[str] = ...,
|
html_message: Optional[str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
|
outbox = [EmailMessage()]
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
# noinspection PyUnresolvedReferences
|
|
||||||
from .base import (
|
|
||||||
clear_script_prefix as clear_script_prefix,
|
|
||||||
clear_url_caches as clear_url_caches,
|
|
||||||
get_script_prefix as get_script_prefix,
|
|
||||||
get_urlconf as get_urlconf,
|
|
||||||
is_valid_path as is_valid_path,
|
|
||||||
resolve as resolve,
|
|
||||||
reverse as reverse,
|
|
||||||
reverse_lazy as reverse_lazy,
|
|
||||||
set_script_prefix as set_script_prefix,
|
|
||||||
set_urlconf as set_urlconf,
|
|
||||||
translate_url as translate_url,
|
|
||||||
)
|
|
||||||
|
|
||||||
# noinspection PyUnresolvedReferences
|
|
||||||
from .conf import include as include, path as path, re_path as re_path
|
|
||||||
|
|
||||||
# noinspection PyUnresolvedReferences
|
|
||||||
from .converters import register_converter as register_converter
|
|
||||||
|
|
||||||
# noinspection PyUnresolvedReferences
|
|
||||||
from .exceptions import NoReverseMatch as NoReverseMatch, Resolver404 as Resolver404
|
|
||||||
|
|
||||||
# noinspection PyUnresolvedReferences
|
|
||||||
from .resolvers import (
|
|
||||||
LocalePrefixPattern as LocalePrefixPattern,
|
|
||||||
ResolverMatch as ResolverMatch,
|
|
||||||
URLPattern as URLPattern,
|
|
||||||
URLResolver as URLResolver,
|
|
||||||
get_ns_resolver as get_ns_resolver,
|
|
||||||
get_resolver as get_resolver,
|
|
||||||
)
|
|
||||||
|
|
||||||
# noinspection PyUnresolvedReferences
|
|
||||||
from .utils import get_callable as get_callable, get_mod_func as get_mod_func
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
|
||||||
from uuid import UUID
|
|
||||||
|
|
||||||
from django.urls.resolvers import ResolverMatch
|
|
||||||
|
|
||||||
from .exceptions import NoReverseMatch, Resolver404
|
|
||||||
from .resolvers import get_ns_resolver, get_resolver
|
|
||||||
from .utils import get_callable
|
|
||||||
|
|
||||||
def resolve(path: str, urlconf: Optional[str] = ...) -> ResolverMatch: ...
|
|
||||||
def reverse(
|
|
||||||
viewname: Optional[Union[Callable, str]],
|
|
||||||
urlconf: Optional[str] = ...,
|
|
||||||
args: Optional[Union[List[UUID], Tuple]] = ...,
|
|
||||||
kwargs: Optional[Union[Dict[str, None], Dict[str, bytes], Dict[str, str], Dict[str, UUID]]] = ...,
|
|
||||||
current_app: Optional[str] = ...,
|
|
||||||
) -> str: ...
|
|
||||||
|
|
||||||
reverse_lazy: Any
|
|
||||||
|
|
||||||
def clear_url_caches() -> None: ...
|
|
||||||
def set_script_prefix(prefix: str) -> None: ...
|
|
||||||
def get_script_prefix() -> str: ...
|
|
||||||
def clear_script_prefix() -> None: ...
|
|
||||||
def set_urlconf(urlconf_name: Optional[Union[Type[Any], str]]) -> None: ...
|
|
||||||
def get_urlconf(default: None = ...) -> Optional[Union[Type[Any], str]]: ...
|
|
||||||
def is_valid_path(path: str, urlconf: Optional[str] = ...) -> bool: ...
|
|
||||||
def translate_url(url: str, lang_code: str) -> str: ...
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
from typing import Any, Callable, List, Optional, Tuple, Union
|
|
||||||
|
|
||||||
from django.urls.resolvers import URLPattern, URLResolver
|
|
||||||
|
|
||||||
from .resolvers import LocalePrefixPattern, RegexPattern, RoutePattern, URLPattern, URLResolver
|
|
||||||
|
|
||||||
def include(
|
|
||||||
arg: Union[List[Tuple[str, Callable]], List[URLPattern], List[URLResolver], Tuple[List[URLResolver], str], str],
|
|
||||||
namespace: Optional[str] = ...,
|
|
||||||
) -> Union[Tuple[List[Any], str, str], Tuple[List[URLResolver], None, None]]: ...
|
|
||||||
|
|
||||||
path: Any
|
|
||||||
re_path: Any
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
from typing import Any, Dict, Optional, Type, Union
|
|
||||||
from uuid import UUID
|
|
||||||
|
|
||||||
class IntConverter:
|
|
||||||
regex: str = ...
|
|
||||||
def to_python(self, value: str) -> int: ...
|
|
||||||
def to_url(self, value: Union[int, str]) -> str: ...
|
|
||||||
|
|
||||||
class StringConverter:
|
|
||||||
regex: str = ...
|
|
||||||
def to_python(self, value: str) -> str: ...
|
|
||||||
def to_url(self, value: Union[int, str, UUID]) -> Union[int, str, UUID]: ...
|
|
||||||
|
|
||||||
class UUIDConverter:
|
|
||||||
regex: str = ...
|
|
||||||
def to_python(self, value: str) -> UUID: ...
|
|
||||||
def to_url(self, value: Union[str, UUID]) -> str: ...
|
|
||||||
|
|
||||||
class SlugConverter(StringConverter):
|
|
||||||
regex: str = ...
|
|
||||||
|
|
||||||
class PathConverter(StringConverter):
|
|
||||||
regex: str = ...
|
|
||||||
|
|
||||||
DEFAULT_CONVERTERS: Any
|
|
||||||
REGISTERED_CONVERTERS: Any
|
|
||||||
|
|
||||||
def register_converter(converter: Type[Any], type_name: str) -> None: ...
|
|
||||||
def get_converters() -> Dict[str, Union[IntConverter, StringConverter, UUIDConverter]]: ...
|
|
||||||
def get_converter(raw_converter: str) -> Union[IntConverter, StringConverter, UUIDConverter]: ...
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
from django.http import Http404
|
|
||||||
|
|
||||||
class Resolver404(Http404):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class NoReverseMatch(Exception):
|
|
||||||
pass
|
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
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.core.checks.messages import CheckMessage, Warning
|
|
||||||
from django.urls.converters import UUIDConverter
|
|
||||||
from django.utils.datastructures import MultiValueDict
|
|
||||||
|
|
||||||
class ResolverMatch:
|
|
||||||
func: Callable = ...
|
|
||||||
args: Tuple = ...
|
|
||||||
kwargs: Dict[str, Any] = ...
|
|
||||||
url_name: Optional[str] = ...
|
|
||||||
app_names: List[str] = ...
|
|
||||||
app_name: str = ...
|
|
||||||
namespaces: List[str] = ...
|
|
||||||
namespace: str = ...
|
|
||||||
view_name: str = ...
|
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
func: Callable,
|
|
||||||
args: Tuple,
|
|
||||||
kwargs: Dict[str, Any],
|
|
||||||
url_name: Optional[str] = ...,
|
|
||||||
app_names: Optional[List[Optional[str]]] = ...,
|
|
||||||
namespaces: Optional[List[Optional[str]]] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def __getitem__(self, index: int) -> Any: ...
|
|
||||||
|
|
||||||
def get_resolver(urlconf: Optional[Union[Type[Any], str]] = ...) -> URLResolver: ...
|
|
||||||
def get_ns_resolver(ns_pattern: str, resolver: URLResolver, converters: Tuple) -> URLResolver: ...
|
|
||||||
|
|
||||||
class LocaleRegexDescriptor:
|
|
||||||
attr: str = ...
|
|
||||||
def __init__(self, attr: Any) -> None: ...
|
|
||||||
def __get__(self, instance: Optional[RegexPattern], cls: Type[RegexPattern] = ...) -> LocaleRegexDescriptor: ...
|
|
||||||
|
|
||||||
class CheckURLMixin:
|
|
||||||
def describe(self) -> str: ...
|
|
||||||
|
|
||||||
class RegexPattern(CheckURLMixin):
|
|
||||||
regex: Any = ...
|
|
||||||
name: Optional[str] = ...
|
|
||||||
converters: Dict[Any, Any] = ...
|
|
||||||
def __init__(self, regex: str, name: Optional[str] = ..., is_endpoint: bool = ...) -> None: ...
|
|
||||||
def match(self, path: str) -> Optional[Tuple[str, Tuple, Dict[str, str]]]: ...
|
|
||||||
def check(self) -> List[Warning]: ...
|
|
||||||
|
|
||||||
class RoutePattern(CheckURLMixin):
|
|
||||||
regex: Any = ...
|
|
||||||
name: Optional[str] = ...
|
|
||||||
converters: Dict[str, UUIDConverter] = ...
|
|
||||||
def __init__(self, route: str, name: Optional[str] = ..., is_endpoint: bool = ...) -> None: ...
|
|
||||||
def match(self, path: str) -> Optional[Tuple[str, Tuple, Dict[str, Union[int, str]]]]: ...
|
|
||||||
def check(self) -> List[Warning]: ...
|
|
||||||
|
|
||||||
class LocalePrefixPattern:
|
|
||||||
prefix_default_language: bool = ...
|
|
||||||
converters: Dict[Any, Any] = ...
|
|
||||||
def __init__(self, prefix_default_language: bool = ...) -> None: ...
|
|
||||||
@property
|
|
||||||
def regex(self): ...
|
|
||||||
@property
|
|
||||||
def language_prefix(self) -> str: ...
|
|
||||||
def match(self, path: str) -> Optional[Tuple[str, Tuple, Dict[Any, Any]]]: ...
|
|
||||||
def check(self) -> List[Any]: ...
|
|
||||||
def describe(self) -> str: ...
|
|
||||||
|
|
||||||
class URLPattern:
|
|
||||||
lookup_str: str
|
|
||||||
pattern: django.urls.resolvers.CheckURLMixin = ...
|
|
||||||
callback: Callable = ...
|
|
||||||
default_args: Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Type[django.contrib.flatpages.sitemaps.FlatPageSitemap]],
|
|
||||||
Dict[str, django.contrib.sitemaps.Sitemap],
|
|
||||||
collections.OrderedDict,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
] = ...
|
|
||||||
name: Optional[str] = ...
|
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
pattern: CheckURLMixin,
|
|
||||||
callback: Callable,
|
|
||||||
default_args: Optional[
|
|
||||||
Union[
|
|
||||||
Dict[str, Dict[str, Type[FlatPageSitemap]]],
|
|
||||||
Dict[str, Dict[str, Sitemap]],
|
|
||||||
Dict[str, OrderedDict],
|
|
||||||
Dict[str, str],
|
|
||||||
]
|
|
||||||
] = ...,
|
|
||||||
name: Optional[str] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def check(self) -> List[Warning]: ...
|
|
||||||
def resolve(self, path: str) -> Optional[ResolverMatch]: ...
|
|
||||||
def lookup_str(self) -> str: ...
|
|
||||||
|
|
||||||
class URLResolver:
|
|
||||||
url_patterns: List[Tuple[str, Callable]]
|
|
||||||
urlconf_module: Optional[Union[List[Tuple[str, Callable]], Type[Any]]]
|
|
||||||
pattern: Union[django.urls.resolvers.CheckURLMixin, django.urls.resolvers.LocalePrefixPattern] = ...
|
|
||||||
urlconf_name: Optional[
|
|
||||||
Union[
|
|
||||||
List[List[Any]],
|
|
||||||
List[Tuple[str, Callable]],
|
|
||||||
List[django.urls.resolvers.URLPattern],
|
|
||||||
List[django.urls.resolvers.URLResolver],
|
|
||||||
Type[Any],
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
] = ...
|
|
||||||
callback: None = ...
|
|
||||||
default_kwargs: Dict[str, Union[Dict[Any, Any], str]] = ...
|
|
||||||
namespace: Optional[str] = ...
|
|
||||||
app_name: Optional[str] = ...
|
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
pattern: Union[CheckURLMixin, LocalePrefixPattern],
|
|
||||||
urlconf_name: Optional[
|
|
||||||
Union[List[List[Any]], List[Tuple[str, Callable]], List[URLPattern], List[URLResolver], Type[Any], str]
|
|
||||||
],
|
|
||||||
default_kwargs: Optional[Union[Dict[str, Dict[Any, Any]], Dict[str, str]]] = ...,
|
|
||||||
app_name: Optional[str] = ...,
|
|
||||||
namespace: Optional[str] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def check(self) -> List[CheckMessage]: ...
|
|
||||||
@property
|
|
||||||
def reverse_dict(self) -> MultiValueDict: ...
|
|
||||||
@property
|
|
||||||
def namespace_dict(self) -> Dict[str, Tuple[str, URLResolver]]: ...
|
|
||||||
@property
|
|
||||||
def app_dict(self) -> Dict[str, List[str]]: ...
|
|
||||||
def resolve(self, path: str) -> ResolverMatch: ...
|
|
||||||
def urlconf_module(self) -> Optional[Union[List[Tuple[str, Callable]], Type[Any]]]: ...
|
|
||||||
def url_patterns(self) -> List[Tuple[str, Callable]]: ...
|
|
||||||
def resolve_error_handler(self, view_type: int) -> Tuple[Callable, Dict[Any, Any]]: ...
|
|
||||||
def reverse(self, lookup_view: str, *args: Any, **kwargs: Any) -> str: ...
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
from typing import Any, Callable, Optional, Tuple, Union
|
|
||||||
|
|
||||||
def get_callable(lookup_view: Union[Callable, str]) -> Callable: ...
|
|
||||||
def get_mod_func(callback: str) -> Tuple[str, str]: ...
|
|
||||||
@@ -1,26 +1,25 @@
|
|||||||
# Stubs for django.conf.urls (Python 3.5)
|
# Stubs for django.conf.urls (Python 3.5)
|
||||||
|
from types import ModuleType
|
||||||
from typing import Any, Callable, Dict, List, Optional, overload, Tuple, Union
|
from typing import Any, Callable, Dict, List, Optional, overload, Tuple, Union
|
||||||
|
|
||||||
from django.http.response import HttpResponse
|
from django.http.response import HttpResponse
|
||||||
from django.urls import RegexURLPattern, RegexURLResolver
|
from django.urls import URLResolver, URLPattern
|
||||||
from django.urls.resolvers import URLConf
|
|
||||||
|
|
||||||
handler400 = ... # type: str
|
handler400 = ... # type: str
|
||||||
handler403 = ... # type: str
|
handler403 = ... # type: str
|
||||||
handler404 = ... # type: str
|
handler404 = ... # type: str
|
||||||
handler500 = ... # type: str
|
handler500 = ... # type: str
|
||||||
|
|
||||||
def include(arg: Any, namespace: str = None, app_name: str = None) -> Tuple[URLConf, Optional[str], Optional[str]]: ...
|
URLConf = Union[str, ModuleType]
|
||||||
|
|
||||||
|
def include(arg: Any, namespace: str = ..., app_name: str = ...) -> Tuple[URLConf, Optional[str], Optional[str]]: ...
|
||||||
@overload
|
@overload
|
||||||
def url(
|
def url(
|
||||||
regex: str, view: Callable[..., HttpResponse], kwargs: Dict[str, Any] = None, name: str = None
|
regex: str, view: Callable[..., HttpResponse], kwargs: Dict[str, Any] = ..., name: str = ...
|
||||||
) -> RegexURLPattern: ... # type: ignore # issue 253 of typing
|
) -> URLPattern: ... # type: ignore # issue 253 of typing
|
||||||
@overload
|
@overload
|
||||||
def url(
|
def url(
|
||||||
regex: str, view: Tuple[URLConf, Optional[str], Optional[str]], kwargs: Dict[str, Any] = None, name: str = None
|
regex: str, view: Tuple[URLConf, Optional[str], Optional[str]], kwargs: Dict[str, Any] = ..., name: str = ...
|
||||||
) -> RegexURLResolver: ...
|
) -> URLResolver: ...
|
||||||
@overload
|
@overload
|
||||||
def url(
|
def url(regex: str, view: List[Union[URLConf, str]], kwargs: Dict[str, Any] = ..., name: str = ...) -> URLResolver: ...
|
||||||
regex: str, view: List[Union[URLConf, str]], kwargs: Dict[str, Any] = None, name: str = None
|
|
||||||
) -> RegexURLResolver: ...
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ from django.core.mail.message import EmailMultiAlternatives as EmailMultiAlterna
|
|||||||
from django.core.mail.message import SafeMIMEMultipart as SafeMIMEMultipart
|
from django.core.mail.message import SafeMIMEMultipart as SafeMIMEMultipart
|
||||||
from django.core.mail.message import SafeMIMEText as SafeMIMEText
|
from django.core.mail.message import SafeMIMEText as SafeMIMEText
|
||||||
from django.core.mail.message import forbid_multi_line_headers as forbid_multi_line_headers
|
from django.core.mail.message import forbid_multi_line_headers as forbid_multi_line_headers
|
||||||
from django.core.mail.message import make_msgid as make_msgid
|
|
||||||
from django.core.mail.utils import DNS_NAME as DNS_NAME
|
from django.core.mail.utils import DNS_NAME as DNS_NAME
|
||||||
from django.core.mail.utils import CachedDnsName as CachedDnsName
|
from django.core.mail.utils import CachedDnsName as CachedDnsName
|
||||||
|
|
||||||
@@ -45,3 +44,5 @@ def mail_managers(
|
|||||||
connection: Optional[BaseEmailBackend] = ...,
|
connection: Optional[BaseEmailBackend] = ...,
|
||||||
html_message: Optional[str] = ...,
|
html_message: Optional[str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
|
outbox = [EmailMessage()]
|
||||||
|
|||||||
@@ -1,8 +1,36 @@
|
|||||||
from .base import reverse as reverse
|
# noinspection PyUnresolvedReferences
|
||||||
|
from .base import (
|
||||||
|
clear_script_prefix as clear_script_prefix,
|
||||||
|
clear_url_caches as clear_url_caches,
|
||||||
|
get_script_prefix as get_script_prefix,
|
||||||
|
get_urlconf as get_urlconf,
|
||||||
|
is_valid_path as is_valid_path,
|
||||||
|
resolve as resolve,
|
||||||
|
reverse as reverse,
|
||||||
|
reverse_lazy as reverse_lazy,
|
||||||
|
set_script_prefix as set_script_prefix,
|
||||||
|
set_urlconf as set_urlconf,
|
||||||
|
translate_url as translate_url,
|
||||||
|
)
|
||||||
|
|
||||||
|
# noinspection PyUnresolvedReferences
|
||||||
from .conf import include as include, path as path, re_path as re_path
|
from .conf import include as include, path as path, re_path as re_path
|
||||||
|
|
||||||
from .resolvers import ResolverMatch as ResolverMatch, get_ns_resolver as get_ns_resolver, get_resolver as get_resolver
|
|
||||||
|
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
from .converters import register_converter as register_converter
|
from .converters import register_converter as register_converter
|
||||||
|
|
||||||
|
# noinspection PyUnresolvedReferences
|
||||||
|
from .exceptions import NoReverseMatch as NoReverseMatch, Resolver404 as Resolver404
|
||||||
|
|
||||||
|
# noinspection PyUnresolvedReferences
|
||||||
|
from .resolvers import (
|
||||||
|
LocalePrefixPattern as LocalePrefixPattern,
|
||||||
|
ResolverMatch as ResolverMatch,
|
||||||
|
URLPattern as URLPattern,
|
||||||
|
URLResolver as URLResolver,
|
||||||
|
get_ns_resolver as get_ns_resolver,
|
||||||
|
get_resolver as get_resolver,
|
||||||
|
)
|
||||||
|
|
||||||
|
# noinspection PyUnresolvedReferences
|
||||||
|
from .utils import get_callable as get_callable, get_mod_func as get_mod_func
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Callable, Dict, Optional, Type, Union, Sequence
|
||||||
from uuid import UUID
|
|
||||||
|
|
||||||
from django.urls.resolvers import ResolverMatch
|
from django.urls.resolvers import ResolverMatch
|
||||||
|
|
||||||
@@ -7,8 +6,8 @@ def resolve(path: str, urlconf: Optional[str] = ...) -> ResolverMatch: ...
|
|||||||
def reverse(
|
def reverse(
|
||||||
viewname: Optional[Union[Callable, str]],
|
viewname: Optional[Union[Callable, str]],
|
||||||
urlconf: Optional[str] = ...,
|
urlconf: Optional[str] = ...,
|
||||||
args: Optional[Union[List[UUID], Tuple]] = ...,
|
args: Optional[Sequence[Any]] = ...,
|
||||||
kwargs: Optional[Union[Dict[str, None], Dict[str, bytes], Dict[str, str], Dict[str, UUID]]] = ...,
|
kwargs: Optional[Dict[str, Any]] = ...,
|
||||||
current_app: Optional[str] = ...,
|
current_app: Optional[str] = ...,
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from .resolvers import URLPattern, URLResolver
|
|||||||
def include(
|
def include(
|
||||||
arg: Union[List[Tuple[str, Callable]], List[URLPattern], List[URLResolver], Tuple[List[URLResolver], str], str],
|
arg: Union[List[Tuple[str, Callable]], List[URLPattern], List[URLResolver], Tuple[List[URLResolver], str], str],
|
||||||
namespace: Optional[str] = ...,
|
namespace: Optional[str] = ...,
|
||||||
) -> Union[Tuple[List[Any], str, str], Tuple[List[URLResolver], None, None]]: ...
|
) -> Tuple[List[URLResolver], Optional[str], Optional[str]]: ...
|
||||||
|
|
||||||
path: Any
|
path: Any
|
||||||
re_path: Any
|
re_path: Any
|
||||||
|
|||||||
@@ -1,30 +1,27 @@
|
|||||||
from typing import Any, Dict, Type, Union
|
from typing import Any, Dict, Type, Union, Protocol
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
class IntConverter:
|
class IntConverter:
|
||||||
regex: str = ...
|
regex: str = ...
|
||||||
def to_python(self, value: str) -> int: ...
|
def to_python(self, value: str) -> int: ...
|
||||||
def to_url(self, value: Union[int, str]) -> str: ...
|
def to_url(self, value: Union[str, int]) -> str: ...
|
||||||
|
|
||||||
class StringConverter:
|
class StringConverter:
|
||||||
regex: str = ...
|
regex: str = ...
|
||||||
def to_python(self, value: str) -> str: ...
|
def to_python(self, value: str) -> str: ...
|
||||||
def to_url(self, value: Union[int, str, UUID]) -> Union[int, str, UUID]: ...
|
def to_url(self, value: str) -> str: ...
|
||||||
|
|
||||||
class UUIDConverter:
|
class UUIDConverter:
|
||||||
regex: str = ...
|
regex: str = ...
|
||||||
def to_python(self, value: str) -> UUID: ...
|
def to_python(self, value: str) -> UUID: ...
|
||||||
def to_url(self, value: Union[str, UUID]) -> str: ...
|
def to_url(self, value: Union[str, UUID]) -> str: ...
|
||||||
|
|
||||||
class SlugConverter(StringConverter):
|
class SlugConverter(StringConverter): ...
|
||||||
regex: str = ...
|
class PathConverter(StringConverter): ...
|
||||||
|
|
||||||
class PathConverter(StringConverter):
|
DEFAULT_CONVERTERS: Dict[str, Any]
|
||||||
regex: str = ...
|
REGISTERED_CONVERTERS: Dict[str, Any]
|
||||||
|
|
||||||
DEFAULT_CONVERTERS: Any
|
|
||||||
REGISTERED_CONVERTERS: Any
|
|
||||||
|
|
||||||
def register_converter(converter: Type[Any], type_name: str) -> None: ...
|
def register_converter(converter: Type[Any], type_name: str) -> None: ...
|
||||||
def get_converters() -> Dict[str, Union[IntConverter, StringConverter, UUIDConverter]]: ...
|
def get_converters() -> Dict[str, Any]: ...
|
||||||
def get_converter(raw_converter: str) -> Union[IntConverter, StringConverter, UUIDConverter]: ...
|
def get_converter(raw_converter: str) -> Any: ...
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class ResolverMatch:
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __getitem__(self, index: int) -> Any: ...
|
def __getitem__(self, index: int) -> Any: ...
|
||||||
|
|
||||||
def get_resolver(urlconf: Optional[Union[Type[Any], str]] = ...) -> URLResolver: ...
|
def get_resolver(urlconf: Optional[str] = ...) -> URLResolver: ...
|
||||||
def get_ns_resolver(ns_pattern: str, resolver: URLResolver, converters: Tuple) -> URLResolver: ...
|
def get_ns_resolver(ns_pattern: str, resolver: URLResolver, converters: Tuple) -> URLResolver: ...
|
||||||
|
|
||||||
class LocaleRegexDescriptor:
|
class LocaleRegexDescriptor:
|
||||||
@@ -59,7 +59,7 @@ class LocalePrefixPattern:
|
|||||||
def regex(self): ...
|
def regex(self): ...
|
||||||
@property
|
@property
|
||||||
def language_prefix(self) -> str: ...
|
def language_prefix(self) -> str: ...
|
||||||
def match(self, path: str) -> Optional[Tuple[str, Tuple, Dict[Any, Any]]]: ...
|
def match(self, path: str) -> Optional[Tuple[str, Tuple, Dict[str, Any]]]: ...
|
||||||
def check(self) -> List[Any]: ...
|
def check(self) -> List[Any]: ...
|
||||||
def describe(self) -> str: ...
|
def describe(self) -> str: ...
|
||||||
|
|
||||||
@@ -77,18 +77,18 @@ class URLPattern:
|
|||||||
|
|
||||||
class URLResolver:
|
class URLResolver:
|
||||||
url_patterns: List[Tuple[str, Callable]]
|
url_patterns: List[Tuple[str, Callable]]
|
||||||
urlconf_module: Optional[Union[List[Tuple[str, Callable]], Type[Any]]]
|
urlconf_module: Optional[List[Tuple[str, Callable]]]
|
||||||
pattern: Any = ...
|
pattern: Any = ...
|
||||||
urlconf_name: Optional[str] = ...
|
urlconf_name: Optional[str] = ...
|
||||||
callback: None = ...
|
callback: None = ...
|
||||||
default_kwargs: Dict[str, Union[Dict[Any, Any], str]] = ...
|
default_kwargs: Dict[str, Any] = ...
|
||||||
namespace: Optional[str] = ...
|
namespace: Optional[str] = ...
|
||||||
app_name: Optional[str] = ...
|
app_name: Optional[str] = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
pattern: Any,
|
pattern: Any,
|
||||||
urlconf_name: Optional[str],
|
urlconf_name: Optional[str],
|
||||||
default_kwargs: Optional[Union[Dict[str, Dict[Any, Any]], Dict[str, str]]] = ...,
|
default_kwargs: Optional[Dict[str, Any]] = ...,
|
||||||
app_name: Optional[str] = ...,
|
app_name: Optional[str] = ...,
|
||||||
namespace: Optional[str] = ...,
|
namespace: Optional[str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@@ -99,7 +99,7 @@ class URLResolver:
|
|||||||
@property
|
@property
|
||||||
def app_dict(self) -> Dict[str, List[str]]: ...
|
def app_dict(self) -> Dict[str, List[str]]: ...
|
||||||
def resolve(self, path: str) -> ResolverMatch: ...
|
def resolve(self, path: str) -> ResolverMatch: ...
|
||||||
def urlconf_module(self) -> Optional[Union[List[Tuple[str, Callable]], Type[Any]]]: ...
|
def urlconf_module(self) -> Optional[List[Tuple[str, Callable]]]: ...
|
||||||
def url_patterns(self) -> List[Tuple[str, Callable]]: ...
|
def url_patterns(self) -> List[Tuple[str, Callable]]: ...
|
||||||
def resolve_error_handler(self, view_type: int) -> Tuple[Callable, Dict[Any, Any]]: ...
|
def resolve_error_handler(self, view_type: int) -> Tuple[Callable, Dict[str, Any]]: ...
|
||||||
def reverse(self, lookup_view: str, *args: Any, **kwargs: Any) -> str: ...
|
def reverse(self, lookup_view: str, *args: Any, **kwargs: Any) -> str: ...
|
||||||
|
|||||||
Reference in New Issue
Block a user