We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fac6cc2 commit e234ef8Copy full SHA for e234ef8
src/django_routify/router.py
@@ -1,5 +1,5 @@
1
from inspect import isclass
2
-from typing import Callable
+from typing import Callable, Type
3
import re
4
5
from django.http import HttpRequest, HttpResponse
@@ -57,9 +57,11 @@ def urls(self) -> list[path]:
57
return self.__urls
58
59
def route(self, url_path: str, name: str = None):
60
+ VIEW_TYPE: Type = Callable[[HttpRequest, ...], HttpResponse]
61
+
62
def register(
- view: Callable[[HttpRequest, ...], HttpResponse] | View
- ) -> Callable[[HttpRequest, ...], HttpResponse]:
63
+ view: VIEW_TYPE | View
64
+ ) -> VIEW_TYPE:
65
nonlocal url_path, name
66
67
if self.__auto_naming and not name:
0 commit comments