"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license. """ from django.urls import include, path from . import api, views app_name = 'projects' # reverse for projects:name _urlpatterns = [ path('', views.project_list, name='project-index'), path('/settings/', views.project_settings, name='project-settings', kwargs={'sub_path': ''}), path('/settings/', views.project_settings, name='project-settings-anything'), ] # reverse for projects:api:name _api_urlpatterns = [ # CRUD path('', api.ProjectListAPI.as_view(), name='project-list'), path('/', api.ProjectAPI.as_view(), name='project-detail'), path('counts/', api.ProjectCountsListAPI.as_view(), name='project-counts-list'), # Get next task path('/next/', api.ProjectNextTaskAPI.as_view(), name='project-next'), # Label stream history path('/label-stream-history/', api.LabelStreamHistoryAPI.as_view(), name='label-stream-history'), # Validate label config in general path('validate/', api.LabelConfigValidateAPI.as_view(), name='label-config-validate'), # Validate label config for project path('/validate/', api.ProjectLabelConfigValidateAPI.as_view(), name='project-label-config-validate'), # Project summary path('/summary/', api.ProjectSummaryAPI.as_view(), name='project-summary'), # Project summary path( '/summary/reset/', api.ProjectSummaryResetAPI.as_view(), name='project-summary-reset', ), # Project import path('/imports//', api.ProjectImportAPI.as_view(), name='project-imports'), # Project reimport path('/reimports//', api.ProjectReimportAPI.as_view(), name='project-reimports'), # Tasks list for the project: get and destroy path('/tasks/', api.ProjectTaskListAPI.as_view(), name='project-tasks-list'), # Generate sample task for this project path('/sample-task/', api.ProjectSampleTask.as_view(), name='project-sample-task'), # List available model versions path('/model-versions/', api.ProjectModelVersions.as_view(), name='project-model-versions'), # List all annotators for project path('/annotators/', api.ProjectAnnotatorsAPI.as_view(), name='project-annotators'), ] _api_urlpatterns_templates = [ path('', api.TemplateListAPI.as_view(), name='template-list'), ] urlpatterns = [ path('projects/', include(_urlpatterns)), path('api/projects/', include((_api_urlpatterns, app_name), namespace='api')), path('api/templates/', include((_api_urlpatterns_templates, app_name), namespace='api-templates')), ]