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

26 lines
547 B
Python
Raw Normal View History

from rest_framework import routers
2016-07-26 14:58:37 -04:00
from . import views
2016-07-26 14:58:37 -04:00
2017-03-20 21:50:10 -04:00
class TenancyRootView(routers.APIRootView):
"""
Tenancy API root view
"""
def get_view_name(self):
return 'Tenancy'
router = routers.DefaultRouter()
2017-03-20 21:50:10 -04:00
router.APIRootView = TenancyRootView
2017-03-09 13:24:02 -05:00
# Field choices
router.register(r'_choices', views.TenancyFieldChoicesViewSet, basename='field-choice')
2017-03-09 13:24:02 -05:00
# Tenants
router.register(r'tenant-groups', views.TenantGroupViewSet)
router.register(r'tenants', views.TenantViewSet)
2017-02-03 16:20:14 -05:00
app_name = 'tenancy-api'
2017-03-09 13:24:02 -05:00
urlpatterns = router.urls