From 3bbfa434603d2c76aa34f9eec5f49384255de778 Mon Sep 17 00:00:00 2001 From: Marti Raudsepp Date: Tue, 19 Mar 2024 16:39:06 +0200 Subject: [PATCH] [3.15] Add SimpleRouter use_regex_path argument (#344) --- rest_framework-stubs/routers.pyi | 2 +- scripts/stubtest/allowlist_todo.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/rest_framework-stubs/routers.pyi b/rest_framework-stubs/routers.pyi index f29b7db01..41c2bbb72 100644 --- a/rest_framework-stubs/routers.pyi +++ b/rest_framework-stubs/routers.pyi @@ -43,7 +43,7 @@ class BaseRouter(metaclass=RenameRouterMethods): class SimpleRouter(BaseRouter): routes: list[Route | DynamicRoute] trailing_slash: str - def __init__(self, trailing_slash: bool = ...) -> None: ... + def __init__(self, trailing_slash: bool = ..., use_regex_path: bool = ...) -> None: ... def get_routes(self, viewset: type[ViewSetMixin]) -> list[Route]: ... def _get_dynamic_route(self, route: DynamicRoute, action: Any) -> Route: ... def get_method_map(self, viewset: type[ViewSetMixin], method_map: Mapping[str, str]) -> dict[str, str]: ... diff --git a/scripts/stubtest/allowlist_todo.txt b/scripts/stubtest/allowlist_todo.txt index b3f0b7077..6ea6358b5 100644 --- a/scripts/stubtest/allowlist_todo.txt +++ b/scripts/stubtest/allowlist_todo.txt @@ -150,7 +150,6 @@ rest_framework.generics.GenericAPIView.__class_getitem__ rest_framework.request.Request.__class_getitem__ rest_framework.response.Response.__class_getitem__ rest_framework.routers.BaseRouter.is_already_registered -rest_framework.routers.SimpleRouter.__init__ rest_framework.schemas.openapi.AutoSchema.get_field_name rest_framework.serializers.DecimalField.__init__ rest_framework.serializers.Field.__class_getitem__