You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
2.5 KiB

  1. from django.urls import path
  2. from rest_framework.authtoken.views import obtain_auth_token
  3. from rest_framework.urlpatterns import format_suffix_patterns
  4. from .views import Me, Features, Users
  5. from .views import ProjectList, ProjectDetail
  6. from .views import LabelList, LabelDetail, ApproveLabelsAPI
  7. from .views import DocumentList, DocumentDetail
  8. from .views import AnnotationList, AnnotationDetail
  9. from .views import TextUploadAPI, TextDownloadAPI, CloudUploadAPI
  10. from .views import StatisticsAPI
  11. from .views import RoleMappingList, RoleMappingDetail, Roles
  12. urlpatterns = [
  13. path('auth-token', obtain_auth_token),
  14. path('me', Me.as_view(), name='me'),
  15. path('features', Features.as_view(), name='features'),
  16. path('cloud-upload', CloudUploadAPI.as_view(), name='cloud_uploader'),
  17. path('projects', ProjectList.as_view(), name='project_list'),
  18. path('users', Users.as_view(), name='user_list'),
  19. path('roles', Roles.as_view(), name='roles'),
  20. path('projects/<int:project_id>', ProjectDetail.as_view(), name='project_detail'),
  21. path('projects/<int:project_id>/statistics',
  22. StatisticsAPI.as_view(), name='statistics'),
  23. path('projects/<int:project_id>/labels',
  24. LabelList.as_view(), name='label_list'),
  25. path('projects/<int:project_id>/labels/<int:label_id>',
  26. LabelDetail.as_view(), name='label_detail'),
  27. path('projects/<int:project_id>/docs',
  28. DocumentList.as_view(), name='doc_list'),
  29. path('projects/<int:project_id>/docs/<int:doc_id>',
  30. DocumentDetail.as_view(), name='doc_detail'),
  31. path('projects/<int:project_id>/docs/<int:doc_id>/approve-labels',
  32. ApproveLabelsAPI.as_view(), name='approve_labels'),
  33. path('projects/<int:project_id>/docs/<int:doc_id>/annotations',
  34. AnnotationList.as_view(), name='annotation_list'),
  35. path('projects/<int:project_id>/docs/<int:doc_id>/annotations/<int:annotation_id>',
  36. AnnotationDetail.as_view(), name='annotation_detail'),
  37. path('projects/<int:project_id>/docs/upload',
  38. TextUploadAPI.as_view(), name='doc_uploader'),
  39. path('projects/<int:project_id>/docs/download',
  40. TextDownloadAPI.as_view(), name='doc_downloader'),
  41. path('projects/<int:project_id>/roles',
  42. RoleMappingList.as_view(), name='rolemapping_list'),
  43. path('projects/<int:project_id>/roles/<int:rolemapping_id>',
  44. RoleMappingDetail.as_view(), name='rolemapping_detail'),
  45. ]
  46. urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'xml'])