urls.py 667 B

123456789101112131415
  1. from django.urls import path, include
  2. from rest_framework_nested import routers
  3. from glitchtip.routers import BulkSimpleRouter
  4. from projects.views import NestedProjectViewSet
  5. from organizations_ext.views import OrganizationMemberViewSet
  6. from .views import TeamViewSet
  7. router = BulkSimpleRouter()
  8. router.register(r"teams", TeamViewSet)
  9. teams_router = routers.NestedSimpleRouter(router, r"teams", lookup="team")
  10. teams_router.register(r"projects", NestedProjectViewSet, basename="team-projects")
  11. teams_router.register(r"members", OrganizationMemberViewSet, basename="team-members")
  12. urlpatterns = [path("", include(router.urls)), path("", include(teams_router.urls))]