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.

54 lines
2.8 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 CommentList, CommentDetail
  10. from .views import TextUploadAPI, TextDownloadAPI, CloudUploadAPI
  11. from .views import StatisticsAPI
  12. from .views import RoleMappingList, RoleMappingDetail, Roles
  13. urlpatterns = [
  14. path('auth-token', obtain_auth_token),
  15. path('me', Me.as_view(), name='me'),
  16. path('features', Features.as_view(), name='features'),
  17. path('cloud-upload', CloudUploadAPI.as_view(), name='cloud_uploader'),
  18. path('projects', ProjectList.as_view(), name='project_list'),
  19. path('users', Users.as_view(), name='user_list'),
  20. path('roles', Roles.as_view(), name='roles'),
  21. path('projects/<int:project_id>', ProjectDetail.as_view(), name='project_detail'),
  22. path('projects/<int:project_id>/statistics',
  23. StatisticsAPI.as_view(), name='statistics'),
  24. path('projects/<int:project_id>/labels',
  25. LabelList.as_view(), name='label_list'),
  26. path('projects/<int:project_id>/labels/<int:label_id>',
  27. LabelDetail.as_view(), name='label_detail'),
  28. path('projects/<int:project_id>/docs',
  29. DocumentList.as_view(), name='doc_list'),
  30. path('projects/<int:project_id>/docs/<int:doc_id>',
  31. DocumentDetail.as_view(), name='doc_detail'),
  32. path('projects/<int:project_id>/docs/<int:doc_id>/approve-labels',
  33. ApproveLabelsAPI.as_view(), name='approve_labels'),
  34. path('projects/<int:project_id>/docs/<int:doc_id>/annotations',
  35. AnnotationList.as_view(), name='annotation_list'),
  36. path('projects/<int:project_id>/docs/<int:doc_id>/annotations/<int:annotation_id>',
  37. AnnotationDetail.as_view(), name='annotation_detail'),
  38. path('projects/<int:project_id>/docs/<int:doc_id>/comments',
  39. CommentList.as_view(), name='comment_list'),
  40. path('projects/<int:project_id>/docs/<int:doc_id>/comments/<int:comment_id>',
  41. CommentDetail.as_view(), name='comment_detail'),
  42. path('projects/<int:project_id>/docs/upload',
  43. TextUploadAPI.as_view(), name='doc_uploader'),
  44. path('projects/<int:project_id>/docs/download',
  45. TextDownloadAPI.as_view(), name='doc_downloader'),
  46. path('projects/<int:project_id>/roles',
  47. RoleMappingList.as_view(), name='rolemapping_list'),
  48. path('projects/<int:project_id>/roles/<int:rolemapping_id>',
  49. RoleMappingDetail.as_view(), name='rolemapping_detail'),
  50. ]
  51. urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'xml'])