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.

167 lines
4.5 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
2 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, comment, example, example_state, health, label,
  3. project, tag, task)
  4. from .views.tasks import category, relation, span, text
  5. urlpatterns_project = [
  6. path(
  7. route='category-types',
  8. view=label.CategoryTypeList.as_view(),
  9. name='category_types'
  10. ),
  11. path(
  12. route='category-types/<int:label_id>',
  13. view=label.CategoryTypeDetail.as_view(),
  14. name='category_type'
  15. ),
  16. path(
  17. route='span-types',
  18. view=label.SpanTypeList.as_view(),
  19. name='span_types'
  20. ),
  21. path(
  22. route='span-types/<int:label_id>',
  23. view=label.SpanTypeDetail.as_view(),
  24. name='span_type'
  25. ),
  26. path(
  27. route='category-type-upload',
  28. view=label.CategoryTypeUploadAPI.as_view(),
  29. name='category_type_upload'
  30. ),
  31. path(
  32. route='span-type-upload',
  33. view=label.SpanTypeUploadAPI.as_view(),
  34. name='span_type_upload'
  35. ),
  36. path(
  37. route='examples',
  38. view=example.ExampleList.as_view(),
  39. name='example_list'
  40. ),
  41. path(
  42. route='examples/<int:example_id>',
  43. view=example.ExampleDetail.as_view(),
  44. name='example_detail'
  45. ),
  46. path(
  47. route='relation_types',
  48. view=label.RelationTypeList.as_view(),
  49. name='relation_types_list'
  50. ),
  51. path(
  52. route='relation_type-upload',
  53. view=label.RelationTypeUploadAPI.as_view(),
  54. name='relation_type-upload'
  55. ),
  56. path(
  57. route='relation_types/<int:relation_type_id>',
  58. view=label.RelationTypeDetail.as_view(),
  59. name='relation_type_detail'
  60. ),
  61. path(
  62. route='annotation_relations',
  63. view=relation.RelationList.as_view(),
  64. name='relation_types_list'
  65. ),
  66. path(
  67. route='annotation_relation-upload',
  68. view=relation.RelationUploadAPI.as_view(),
  69. name='annotation_relation-upload'
  70. ),
  71. path(
  72. route='annotation_relations/<int:annotation_relation_id>',
  73. view=relation.RelationDetail.as_view(),
  74. name='annotation_relation_detail'
  75. ),
  76. path(
  77. route='approval/<int:example_id>',
  78. view=annotation.ApprovalAPI.as_view(),
  79. name='approve_labels'
  80. ),
  81. path(
  82. route='examples/<int:example_id>/categories',
  83. view=category.CategoryListAPI.as_view(),
  84. name='category_list'
  85. ),
  86. path(
  87. route='examples/<int:example_id>/categories/<int:annotation_id>',
  88. view=category.CategoryDetailAPI.as_view(),
  89. name='category_detail'
  90. ),
  91. path(
  92. route='examples/<int:example_id>/spans',
  93. view=span.SpanListAPI.as_view(),
  94. name='span_list'
  95. ),
  96. path(
  97. route='examples/<int:example_id>/spans/<int:annotation_id>',
  98. view=span.SpanDetailAPI.as_view(),
  99. name='span_detail'
  100. ),
  101. path(
  102. route='examples/<int:example_id>/texts',
  103. view=text.TextLabelListAPI.as_view(),
  104. name='text_list'
  105. ),
  106. path(
  107. route='examples/<int:example_id>/texts/<int:annotation_id>',
  108. view=text.TextLabelDetailAPI.as_view(),
  109. name='text_detail'
  110. ),
  111. path(
  112. route='tags',
  113. view=tag.TagList.as_view(),
  114. name='tag_list'
  115. ),
  116. path(
  117. route='tags/<int:tag_id>',
  118. view=tag.TagDetail.as_view(),
  119. name='tag_detail'
  120. ),
  121. path(
  122. route='examples/<int:example_id>/comments',
  123. view=comment.CommentListDoc.as_view(),
  124. name='comment_list_doc'
  125. ),
  126. path(
  127. route='comments',
  128. view=comment.CommentListProject.as_view(),
  129. name='comment_list_project'
  130. ),
  131. path(
  132. route='examples/<int:example_id>/comments/<int:comment_id>',
  133. view=comment.CommentDetail.as_view(),
  134. name='comment_detail'
  135. ),
  136. path(
  137. route='examples/<int:example_id>/states',
  138. view=example_state.ExampleStateList.as_view(),
  139. name='example_state_list'
  140. ),
  141. ]
  142. urlpatterns = [
  143. path(
  144. route='health',
  145. view=health.Health.as_view(),
  146. name='health'
  147. ),
  148. path(
  149. route='projects',
  150. view=project.ProjectList.as_view(),
  151. name='project_list'
  152. ),
  153. path(
  154. route='tasks/status/<task_id>',
  155. view=task.TaskStatus.as_view(),
  156. name='task_status'
  157. ),
  158. path(
  159. route='projects/<int:project_id>',
  160. view=project.ProjectDetail.as_view(),
  161. name='project_detail'
  162. ),
  163. path('projects/<int:project_id>/', include(urlpatterns_project))
  164. ]