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 CircuitsRootView(routers.APIRootView):
"""
Circuits API root view
"""
def get_view_name(self):
return 'Circuits'
router = routers.DefaultRouter()
router.APIRootView = CircuitsRootView
router = OrderedDefaultRouter()
router.APIRootView = views.CircuitsRootView
# Providers
router.register('providers', views.ProviderViewSet)