2018-07-12 16:31:50 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
|
2020-08-03 08:17:46 +00:00
|
|
|
from django.urls import re_path
|
2018-07-25 03:21:12 +00:00
|
|
|
from rest_framework.routers import DefaultRouter
|
2020-08-03 08:17:46 +00:00
|
|
|
from rest_framework_bulk.routes import BulkRouter
|
2019-08-21 12:27:21 +00:00
|
|
|
|
|
|
|
from common import api as capi
|
2018-07-25 03:21:12 +00:00
|
|
|
from .. import api
|
|
|
|
|
2018-07-12 16:31:50 +00:00
|
|
|
|
|
|
|
app_name = 'orgs'
|
2018-07-25 03:21:12 +00:00
|
|
|
router = DefaultRouter()
|
2020-08-03 08:17:46 +00:00
|
|
|
bulk_router = BulkRouter()
|
2018-11-02 06:38:44 +00:00
|
|
|
|
2018-07-25 03:21:12 +00:00
|
|
|
router.register(r'orgs', api.OrgViewSet, 'org')
|
2020-11-03 13:48:05 +00:00
|
|
|
bulk_router.register(r'org-member-relation', api.OrgMemberRelationBulkViewSet, 'org-member-relation')
|
2018-07-25 03:21:12 +00:00
|
|
|
|
2020-11-06 02:46:04 +00:00
|
|
|
router.register(r'orgs/(?P<org_id>[0-9a-zA-Z\-]{36})/membership/admins',
|
|
|
|
api.OrgMemberAdminRelationBulkViewSet, 'membership-admins')
|
|
|
|
router.register(r'orgs/(?P<org_id>[0-9a-zA-Z\-]{36})/membership/users',
|
|
|
|
api.OrgMemberUserRelationBulkViewSet, 'membership-users'),
|
|
|
|
|
2019-08-21 12:27:21 +00:00
|
|
|
old_version_urlpatterns = [
|
|
|
|
re_path('(?P<resource>org)/.*', capi.redirect_plural_name_api)
|
|
|
|
]
|
2018-07-12 16:31:50 +00:00
|
|
|
|
2020-08-03 08:17:46 +00:00
|
|
|
urlpatterns = router.urls + bulk_router.urls + old_version_urlpatterns
|