Skip to content

Commit 07851bd

Browse files
committed
route refactor
1 parent e0e9886 commit 07851bd

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

ninja_extra/constants.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
POST = "POST"
2+
PUT = "PUT"
3+
PATCH = "PATCH"
4+
DELETE = "DELETE"
5+
GET = "GET"
6+
HEAD = "HEAD"
7+
OPTIONS = "OPTIONS"
8+
TRACE = "TRACE"
9+
ROUTE_METHODS = [POST, PUT, PATCH, DELETE, GET, HEAD, OPTIONS, TRACE]

ninja_extra/controllers/route/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,13 @@
55
from ninja.signature import is_async
66
from ninja.types import TCallable
77

8+
from ninja_extra.constants import DELETE, GET, PATCH, POST, PUT, ROUTE_METHODS
89
from ninja_extra.controllers.response import ControllerResponse
910
from ninja_extra.permissions import BasePermission
1011
from ninja_extra.schemas import RouteParameter
1112

1213
from .route_functions import AsyncRouteFunction, RouteFunction
1314

14-
POST = "POST"
15-
PUT = "PUT"
16-
PATCH = "PATCH"
17-
DELETE = "DELETE"
18-
GET = "GET"
19-
ROUTE_METHODS = [POST, PUT, PATCH, DELETE, GET]
20-
2115

2216
class RouteInvalidParameterException(Exception):
2317
pass

0 commit comments

Comments
 (0)