2017-05-24 11:33:11 -04:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2017-01-26 15:34:07 -05:00
|
|
|
from rest_framework import routers
|
2016-03-01 11:23:03 -05:00
|
|
|
|
2017-01-26 17:18:41 -05:00
|
|
|
from . import views
|
2017-01-26 15:34:07 -05:00
|
|
|
|
2016-03-01 11:23:03 -05:00
|
|
|
|
2017-03-20 21:50:10 -04:00
|
|
|
class CircuitsRootView(routers.APIRootView):
|
|
|
|
"""
|
|
|
|
Circuits API root view
|
|
|
|
"""
|
|
|
|
def get_view_name(self):
|
|
|
|
return 'Circuits'
|
|
|
|
|
|
|
|
|
2017-01-26 15:34:07 -05:00
|
|
|
router = routers.DefaultRouter()
|
2017-03-20 21:50:10 -04:00
|
|
|
router.APIRootView = CircuitsRootView
|
2017-03-09 13:24:02 -05:00
|
|
|
|
2017-10-10 16:41:35 -04:00
|
|
|
# Field choices
|
|
|
|
router.register(r'_choices', views.CircuitsFieldChoicesViewSet, base_name='field-choice')
|
|
|
|
|
2017-03-09 13:24:02 -05:00
|
|
|
# Providers
|
2017-01-26 17:18:41 -05:00
|
|
|
router.register(r'providers', views.ProviderViewSet)
|
2017-03-09 13:24:02 -05:00
|
|
|
|
|
|
|
# Circuits
|
2017-01-26 17:18:41 -05:00
|
|
|
router.register(r'circuit-types', views.CircuitTypeViewSet)
|
|
|
|
router.register(r'circuits', views.CircuitViewSet)
|
|
|
|
router.register(r'circuit-terminations', views.CircuitTerminationViewSet)
|
2017-02-03 16:20:14 -05:00
|
|
|
|
2017-04-05 14:26:33 -04:00
|
|
|
app_name = 'circuits-api'
|
2017-03-09 13:24:02 -05:00
|
|
|
urlpatterns = router.urls
|