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.

37 lines
1.6 KiB

  1. from django.urls import path
  2. from rest_framework.urlpatterns import format_suffix_patterns
  3. from .api import Me
  4. from .api import ProjectList, ProjectDetail
  5. from .api import LabelList, LabelDetail
  6. from .api import DocumentList, DocumentDetail
  7. from .api import AnnotationList, AnnotationDetail
  8. from .api import TextUploadAPI, TextDownloadAPI
  9. from .api import StatisticsAPI
  10. urlpatterns = [
  11. path('me', Me.as_view(), name='me'),
  12. path('projects', ProjectList.as_view(), name='project_list'),
  13. path('projects/<int:project_id>', ProjectDetail.as_view(), name='project_detail'),
  14. path('projects/<int:project_id>/statistics',
  15. StatisticsAPI.as_view(), name='statistics'),
  16. path('projects/<int:project_id>/labels',
  17. LabelList.as_view(), name='label_list'),
  18. path('projects/<int:project_id>/labels/<int:label_id>',
  19. LabelDetail.as_view(), name='label_detail'),
  20. path('projects/<int:project_id>/docs',
  21. DocumentList.as_view(), name='doc_list'),
  22. path('projects/<int:project_id>/docs/<int:doc_id>',
  23. DocumentDetail.as_view(), name='doc_detail'),
  24. path('projects/<int:project_id>/docs/<int:doc_id>/annotations',
  25. AnnotationList.as_view(), name='annotation_list'),
  26. path('projects/<int:project_id>/docs/<int:doc_id>/annotations/<int:annotation_id>',
  27. AnnotationDetail.as_view(), name='annotation_detail'),
  28. path('projects/<int:project_id>/docs/upload',
  29. TextUploadAPI.as_view(), name='doc_uploader'),
  30. path('projects/<int:project_id>/docs/download',
  31. TextDownloadAPI.as_view(), name='doc_downloader')
  32. ]
  33. urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'xml'])