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.

246 lines
6.8 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
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
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
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 .views import (annotation, annotation_relations, auto_labeling, comment,
  3. example, example_state, export_dataset, health,
  4. import_dataset, import_export, label, project,
  5. relation_types, role, statistics, tag, task, user)
  6. urlpatterns_project = [
  7. path(
  8. route='upload',
  9. view=import_dataset.UploadAPI.as_view(),
  10. name='upload'
  11. ),
  12. path(
  13. route='catalog',
  14. view=import_dataset.DatasetCatalog.as_view(),
  15. name='catalog'
  16. ),
  17. path(
  18. route='download-format',
  19. view=export_dataset.DownloadDatasetCatalog.as_view(),
  20. name='download-format'
  21. ),
  22. path(
  23. route='download',
  24. view=export_dataset.DownloadAPI.as_view(),
  25. name='download-dataset'
  26. ),
  27. path(
  28. route='statistics',
  29. view=statistics.StatisticsAPI.as_view(),
  30. name='statistics'),
  31. path(
  32. route='labels',
  33. view=label.LabelList.as_view(),
  34. name='label_list'
  35. ),
  36. path(
  37. route='label-upload',
  38. view=label.LabelUploadAPI.as_view(),
  39. name='label_upload'
  40. ),
  41. path(
  42. route='labels/<int:label_id>',
  43. view=label.LabelDetail.as_view(),
  44. name='label_detail'
  45. ),
  46. path(
  47. route='examples',
  48. view=example.ExampleList.as_view(),
  49. name='example_list'
  50. ),
  51. path(
  52. route='examples/<int:example_id>',
  53. view=example.ExampleDetail.as_view(),
  54. name='example_detail'
  55. ),
  56. path(
  57. route='relation_types',
  58. view=relation_types.RelationTypesList.as_view(),
  59. name='relation_types_list'
  60. ),
  61. path(
  62. route='relation_type-upload',
  63. view=relation_types.RelationTypesUploadAPI.as_view(),
  64. name='relation_type-upload'
  65. ),
  66. path(
  67. route='relation_types/<int:relation_type_id>',
  68. view=relation_types.RelationTypesDetail.as_view(),
  69. name='relation_type_detail'
  70. ),
  71. path(
  72. route='annotation_relations',
  73. view=annotation_relations.AnnotationRelationsList.as_view(),
  74. name='relation_types_list'
  75. ),
  76. path(
  77. route='annotation_relation-upload',
  78. view=annotation_relations.AnnotationRelationsUploadAPI.as_view(),
  79. name='annotation_relation-upload'
  80. ),
  81. path(
  82. route='annotation_relations/<int:annotation_relation_id>',
  83. view=annotation_relations.AnnotationRelationsDetail.as_view(),
  84. name='annotation_relation_detail'
  85. ),
  86. # Todo: remove.
  87. path(
  88. route='docs',
  89. view=example.DocumentList.as_view(),
  90. name='doc_list'
  91. ),
  92. path(
  93. route='docs/<int:doc_id>',
  94. view=example.DocumentDetail.as_view(),
  95. name='doc_detail'
  96. ),
  97. path(
  98. route='approval/<int:example_id>',
  99. view=annotation.ApprovalAPI.as_view(),
  100. name='approve_labels'
  101. ),
  102. # Todo: change.
  103. path(
  104. route='docs/<int:doc_id>/annotations',
  105. view=annotation.AnnotationList.as_view(),
  106. name='annotation_list'
  107. ),
  108. path(
  109. route='docs/<int:doc_id>/annotations/<int:annotation_id>',
  110. view=annotation.AnnotationDetail.as_view(),
  111. name='annotation_detail'
  112. ),
  113. path(
  114. route='tags',
  115. view=tag.TagList.as_view(),
  116. name='tag_list'
  117. ),
  118. path(
  119. route='tags/<int:tag_id>',
  120. view=tag.TagDetail.as_view(),
  121. name='tag_detail'
  122. ),
  123. path(
  124. route='examples/<int:example_id>/comments',
  125. view=comment.CommentListDoc.as_view(),
  126. name='comment_list_doc'
  127. ),
  128. path(
  129. route='comments',
  130. view=comment.CommentListProject.as_view(),
  131. name='comment_list_project'
  132. ),
  133. path(
  134. route='examples/<int:example_id>/comments/<int:comment_id>',
  135. view=comment.CommentDetail.as_view(),
  136. name='comment_detail'
  137. ),
  138. path(
  139. route='examples/<int:example_id>/states',
  140. view=example_state.ExampleStateList.as_view(),
  141. name='example_state_list'
  142. ),
  143. path(
  144. route='roles',
  145. view=role.RoleMappingList.as_view(),
  146. name='rolemapping_list'
  147. ),
  148. path(
  149. route='roles/<int:rolemapping_id>',
  150. view=role.RoleMappingDetail.as_view(),
  151. name='rolemapping_detail'
  152. ),
  153. path(
  154. route='auto-labeling-templates',
  155. view=auto_labeling.AutoLabelingTemplateListAPI.as_view(),
  156. name='auto_labeling_templates'
  157. ),
  158. path(
  159. route='auto-labeling-templates/<str:option_name>',
  160. view=auto_labeling.AutoLabelingTemplateDetailAPI.as_view(),
  161. name='auto_labeling_template'
  162. ),
  163. path(
  164. route='auto-labeling-configs',
  165. view=auto_labeling.AutoLabelingConfigList.as_view(),
  166. name='auto_labeling_configs'
  167. ),
  168. path(
  169. route='auto-labeling-configs/<int:config_id>',
  170. view=auto_labeling.AutoLabelingConfigDetail.as_view(),
  171. name='auto_labeling_config'
  172. ),
  173. path(
  174. route='auto-labeling-config-testing',
  175. view=auto_labeling.AutoLabelingConfigTest.as_view(),
  176. name='auto_labeling_config_test'
  177. ),
  178. path(
  179. route='examples/<int:example_id>/auto-labeling',
  180. view=auto_labeling.AutoLabelingAnnotation.as_view(),
  181. name='auto_labeling_annotation'
  182. ),
  183. path(
  184. route='auto-labeling-parameter-testing',
  185. view=auto_labeling.AutoLabelingConfigParameterTest.as_view(),
  186. name='auto_labeling_parameter_testing'
  187. ),
  188. path(
  189. route='auto-labeling-template-testing',
  190. view=auto_labeling.AutoLabelingTemplateTest.as_view(),
  191. name='auto_labeling_template_test'
  192. ),
  193. path(
  194. route='auto-labeling-mapping-testing',
  195. view=auto_labeling.AutoLabelingMappingTest.as_view(),
  196. name='auto_labeling_mapping_test'
  197. )
  198. ]
  199. urlpatterns = [
  200. path(
  201. route='health',
  202. view=health.Health.as_view(),
  203. name='health'
  204. ),
  205. path('auth/', include('dj_rest_auth.urls')),
  206. path('fp/', include('django_drf_filepond.urls')),
  207. path(
  208. route='me',
  209. view=user.Me.as_view(),
  210. name='me'
  211. ),
  212. path(
  213. route='features',
  214. view=import_export.Features.as_view(),
  215. name='features'
  216. ),
  217. path(
  218. route='projects',
  219. view=project.ProjectList.as_view(),
  220. name='project_list'
  221. ),
  222. path(
  223. route='users',
  224. view=user.Users.as_view(),
  225. name='user_list'
  226. ),
  227. path(
  228. route='roles',
  229. view=role.Roles.as_view(),
  230. name='roles'
  231. ),
  232. path(
  233. route='tasks/status/<task_id>',
  234. view=task.TaskStatus.as_view(),
  235. name='task_status'
  236. ),
  237. path(
  238. route='projects/<int:project_id>',
  239. view=project.ProjectDetail.as_view(),
  240. name='project_detail'
  241. ),
  242. path('projects/<int:project_id>/', include(urlpatterns_project))
  243. ]