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.

39 lines
1.8 KiB

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