urls.py 919 B

123456789101112131415161718192021222324252627282930313233343536
  1. from django.urls import include, path
  2. from rest_framework_nested import routers
  3. from apps.performance.views import (
  4. SpanViewSet,
  5. TransactionGroupViewSet,
  6. TransactionViewSet,
  7. )
  8. from glitchtip.routers import BulkSimpleRouter
  9. from .views import OrganizationViewSet
  10. router = BulkSimpleRouter()
  11. router.register(r"organizations", OrganizationViewSet)
  12. organizations_router = routers.NestedSimpleRouter(
  13. router, r"organizations", lookup="organization"
  14. )
  15. organizations_router.register(
  16. r"transactions", TransactionViewSet, basename="organization-transactions"
  17. )
  18. organizations_router.register(
  19. r"transaction-groups",
  20. TransactionGroupViewSet,
  21. basename="organization-transaction-groups",
  22. )
  23. organizations_router.register(
  24. r"spans",
  25. SpanViewSet,
  26. basename="organization-spans",
  27. )
  28. urlpatterns = [
  29. path("", include(router.urls)),
  30. path("", include(organizations_router.urls)),
  31. ]