2017-01-26 15:34:07 -05:00
|
|
|
from rest_framework import routers
|
2016-07-26 14:58:37 -04:00
|
|
|
|
2017-01-26 17:58:36 -05: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'
|
|
|
|
|
|
|
|
|
2017-01-26 15:34:07 -05:00
|
|
|
router = routers.DefaultRouter()
|
2017-03-20 21:50:10 -04:00
|
|
|
router.APIRootView = TenancyRootView
|
2017-03-09 13:24:02 -05:00
|
|
|
|
2017-10-10 16:41:35 -04:00
|
|
|
# Field choices
|
2018-11-02 13:48:44 -04:00
|
|
|
router.register(r'_choices', views.TenancyFieldChoicesViewSet, basename='field-choice')
|
2017-10-10 16:41:35 -04:00
|
|
|
|
2017-03-09 13:24:02 -05:00
|
|
|
# Tenants
|
2017-01-26 17:58:36 -05:00
|
|
|
router.register(r'tenant-groups', views.TenantGroupViewSet)
|
|
|
|
router.register(r'tenants', views.TenantViewSet)
|
2017-02-03 16:20:14 -05:00
|
|
|
|
2017-04-05 14:26:33 -04:00
|
|
|
app_name = 'tenancy-api'
|
2017-03-09 13:24:02 -05:00
|
|
|
urlpatterns = router.urls
|