1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #4997: Introduce OrderedDefaultRouter; move root API views to views.py

This commit is contained in:
Jeremy Stretch
2020-08-13 12:45:38 -04:00
parent a08418bff8
commit fd139a77f5
18 changed files with 118 additions and 97 deletions

View File

@@ -1,18 +1,9 @@
from rest_framework import routers
from utilities.api import OrderedDefaultRouter
from . import views
class DCIMRootView(routers.APIRootView):
"""
DCIM API root view
"""
def get_view_name(self):
return 'DCIM'
router = routers.DefaultRouter()
router.APIRootView = DCIMRootView
router = OrderedDefaultRouter()
router.APIRootView = views.DCIMRootView
# Sites
router.register('regions', views.RegionViewSet)