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.

180 lines
4.6 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. from django.urls import include, path
  2. from rest_framework.authtoken.views import obtain_auth_token
  3. from . import views
  4. urlpatterns_project = [
  5. path(
  6. route='statistics',
  7. view=views.StatisticsAPI.as_view(),
  8. name='statistics'),
  9. path(
  10. route='labels',
  11. view=views.LabelList.as_view(),
  12. name='label_list'
  13. ),
  14. path(
  15. route='label-upload',
  16. view=views.LabelUploadAPI.as_view(),
  17. name='label_upload'
  18. ),
  19. path(
  20. route='labels/<int:label_id>',
  21. view=views.LabelDetail.as_view(),
  22. name='label_detail'
  23. ),
  24. path(
  25. route='docs',
  26. view=views.DocumentList.as_view(),
  27. name='doc_list'
  28. ),
  29. path(
  30. route='docs/<int:doc_id>',
  31. view=views.DocumentDetail.as_view(),
  32. name='doc_detail'
  33. ),
  34. path(
  35. route='docs/<int:doc_id>/approve-labels',
  36. view=views.ApproveLabelsAPI.as_view(),
  37. name='approve_labels'
  38. ),
  39. path(
  40. route='docs/<int:doc_id>/annotations',
  41. view=views.AnnotationList.as_view(),
  42. name='annotation_list'
  43. ),
  44. path(
  45. route='docs/<int:doc_id>/annotations/<int:annotation_id>',
  46. view=views.AnnotationDetail.as_view(),
  47. name='annotation_detail'
  48. ),
  49. path(
  50. route='docs/<int:doc_id>/comments',
  51. view=views.CommentListDoc.as_view(),
  52. name='comment_list_doc'
  53. ),
  54. path(
  55. route='comments',
  56. view=views.CommentListProject.as_view(),
  57. name='comment_list_project'
  58. ),
  59. path(
  60. route='docs/<int:doc_id>/comments/<int:comment_id>',
  61. view=views.CommentDetail.as_view(),
  62. name='comment_detail'
  63. ),
  64. path(
  65. route='docs/upload',
  66. view=views.TextUploadAPI.as_view(),
  67. name='doc_uploader'
  68. ),
  69. path(
  70. route='docs/download',
  71. view=views.TextDownloadAPI.as_view(),
  72. name='doc_downloader'
  73. ),
  74. path(
  75. route='roles',
  76. view=views.RoleMappingList.as_view(),
  77. name='rolemapping_list'
  78. ),
  79. path(
  80. route='roles/<int:rolemapping_id>',
  81. view=views.RoleMappingDetail.as_view(),
  82. name='rolemapping_detail'
  83. ),
  84. path(
  85. route='auto-labeling-templates',
  86. view=views.AutoLabelingTemplateListAPI.as_view(),
  87. name='auto_labeling_templates'
  88. ),
  89. path(
  90. route='auto-labeling-templates/<str:option_name>',
  91. view=views.AutoLabelingTemplateDetailAPI.as_view(),
  92. name='auto_labeling_template'
  93. ),
  94. path(
  95. route='auto-labeling-configs',
  96. view=views.AutoLabelingConfigList.as_view(),
  97. name='auto_labeling_configs'
  98. ),
  99. path(
  100. route='auto-labeling-configs/<int:config_id>',
  101. view=views.AutoLabelingConfigDetail.as_view(),
  102. name='auto_labeling_config'
  103. ),
  104. path(
  105. route='auto-labeling-config-testing',
  106. view=views.AutoLabelingConfigTest.as_view(),
  107. name='auto_labeling_config_test'
  108. ),
  109. path(
  110. route='docs/<int:doc_id>/auto-labeling',
  111. view=views.AutoLabelingAnnotation.as_view(),
  112. name='auto_labeling_annotation'
  113. ),
  114. path(
  115. route='auto-labeling-template-testing',
  116. view=views.AutoLabelingTemplateTest.as_view(),
  117. name='auto_labeling_template_test'
  118. ),
  119. path(
  120. route='auto-labeling-mapping-testing',
  121. view=views.AutoLabelingMappingTest.as_view(),
  122. name='auto_labeling_mapping_test'
  123. )
  124. ]
  125. urlpatterns = [
  126. path(
  127. route='health',
  128. view=views.Health.as_view(),
  129. name='health'
  130. ),
  131. path(
  132. route='auth-token',
  133. view=obtain_auth_token
  134. ),
  135. path(
  136. route='me',
  137. view=views.Me.as_view(),
  138. name='me'
  139. ),
  140. path(
  141. route='features',
  142. view=views.Features.as_view(),
  143. name='features'
  144. ),
  145. path(
  146. route='cloud-upload',
  147. view=views.CloudUploadAPI.as_view(),
  148. name='cloud_uploader'
  149. ),
  150. path(
  151. route='projects',
  152. view=views.ProjectList.as_view(),
  153. name='project_list'
  154. ),
  155. path(
  156. route='users',
  157. view=views.Users.as_view(),
  158. name='user_list'
  159. ),
  160. path(
  161. route='roles',
  162. view=views.Roles.as_view(),
  163. name='roles'
  164. ),
  165. path(
  166. route='auto-labeling-parameter-testing',
  167. view=views.AutoLabelingConfigParameterTest.as_view(),
  168. name='auto_labeling_parameter_testing'
  169. ),
  170. path(
  171. route='projects/<int:project_id>',
  172. view=views.ProjectDetail.as_view(),
  173. name='project_detail'
  174. ),
  175. path('projects/<int:project_id>/', include(urlpatterns_project))
  176. ]