Commit 60b19050 authored by Samuel GAIST's avatar Samuel GAIST

[api_urls] Migrate to new Django style using path

parent d642e93d
......@@ -25,51 +25,52 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_accounts"
urlpatterns = [
url(r"^$", api.SupervisorListView.as_view(), name="list_supervisee"),
url(
path("", api.SupervisorListView.as_view(), name="list_supervisee"),
re_path(
r"^(?P<supervisee_name>[\w\W]+)/validate/$",
api.SupervisorAddSuperviseeView.as_view(),
name="validate_supervisee",
),
url(
re_path(
r"^(?P<supervisee_name>[\w\W]+)/remove/$",
api.SupervisorRemoveSuperviseeView.as_view(),
name="remove_supervisee",
),
url(
re_path(
r"^(?P<supervisor_name>[\w\W]+)/add/$",
api.SuperviseeAddSupervisorView.as_view(),
name="add_supervisor",
),
url(
r"^revalidate/$",
path(
"revalidate/",
api.SuperviseeReValidationView.as_view(),
name="revalidate_account",
),
url(
r"^set_supervisor_mode/$",
path(
"set_supervisor_mode/",
api.SetSupervisorModeView.as_view(),
name="set_supervisor_mode",
),
url(
r"^remove_supervisor_mode/$",
path(
"remove_supervisor_mode/",
api.RemoveSupervisorModeView.as_view(),
name="remove_supervisor_mode",
),
url(
r"^list_supervisor_candidates/$",
path(
"list_supervisor_candidates/",
api.ListSupervisorCandidatesView.as_view(),
name="list_supervisor_candidates",
),
url(
r"^grant_supervisor_access/$",
path(
"grant_supervisor_access/",
api.UpdateSupervisorCandidateView.as_view(),
name="update_supervisor_candidate",
),
......
......@@ -25,36 +25,37 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_algorithms"
urlpatterns = [
url(r"^$", api.ListAlgorithmsView.as_view(), name="all"),
url(r"^check_name/$", api.CheckAlgorithmNameView.as_view(), name="check_name"),
url(
path("", api.ListAlgorithmsView.as_view(), name="all"),
path("check_name/", api.CheckAlgorithmNameView.as_view(), name="check_name"),
re_path(
r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
api.DiffAlgorithmView.as_view(),
name="diff",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<object_name>[-\w]+)/(?P<version>\d+)/share/$",
api.ShareAlgorithmView.as_view(),
name="share",
),
url(
re_path(
r"^(?P<author_name>\w+)/$",
api.ListCreateAlgorithmsView.as_view(),
name="list_create",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<object_name>[-\w]+)/(?P<version>\d+)/$",
api.RetrieveUpdateDestroyAlgorithmsView.as_view(),
name="object",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<object_name>[-\w]+)/(?P<version>\d+)/file/$",
api.FileHandlingView.as_view(),
name="file",
......
......@@ -25,17 +25,16 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_attestations"
urlpatterns = [
url(r"^$", api.CreateAttestationView.as_view(), name="create"),
url(
r"^unlock/(?P<number>\d+)/$", api.UnlockAttestationView.as_view(), name="unlock"
),
url(r"^(?P<number>\d+)/$", api.DeleteAttestationView.as_view(), name="delete"),
url(r"^(?P<username>\w+)/$", api.ListUserAttestationView.as_view(), name="all"),
path("", api.CreateAttestationView.as_view(), name="create"),
path("unlock/<int:number>/", api.UnlockAttestationView.as_view(), name="unlock"),
path("<int:number>/", api.DeleteAttestationView.as_view(), name="delete"),
re_path(r"^(?P<username>\w+)/$", api.ListUserAttestationView.as_view(), name="all"),
]
......@@ -25,15 +25,15 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from . import api
app_name = "api_backend"
urlpatterns = [
url(
r"^environments/$",
path(
"environments/",
api.accessible_environments_list,
name="backend-api-environments",
),
......
......@@ -25,16 +25,17 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_databases"
urlpatterns = [
url(r"^$", api.ListCreateDatabasesView.as_view(), name="all"),
url(r"^templates/$", api.ListTemplatesView.as_view(), name="templates"),
url(
path("", api.ListCreateDatabasesView.as_view(), name="all"),
path("templates/", api.ListTemplatesView.as_view(), name="templates"),
re_path(
r"^(?P<database_name>[-\w]+)/(?P<version>\d+)/$",
api.RetrieveDatabaseView.as_view(),
name="object",
......
......@@ -25,31 +25,32 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_dataformats"
urlpatterns = [
url(r"^$", api.ListDataFormatView.as_view(), name="all"),
url(r"^check_name/$", api.CheckDataFormatNameView.as_view(), name="check_name"),
url(
path("", api.ListDataFormatView.as_view(), name="all"),
path("check_name/", api.CheckDataFormatNameView.as_view(), name="check_name"),
re_path(
r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
api.DiffDataFormatView.as_view(),
name="diff",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<object_name>[a-zA-Z0-9_\-]+)/(?P<version>\d+)/share/$",
api.ShareDataFormatView.as_view(),
name="share",
),
url(
re_path(
r"^(?P<author_name>\w+)/$",
api.ListCreateDataFormatsView.as_view(),
name="list_create",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<object_name>[a-zA-Z0-9_\-]+)/(?P<version>\d+)/$",
api.RetrieveUpdateDestroyDataFormatsView.as_view(),
name="object",
......
......@@ -25,51 +25,52 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_experiments"
urlpatterns = [
url(r"^$", api.ListExperimentsView.as_view(), name="all"),
path("", api.ListExperimentsView.as_view(), name="all"),
# Sharing
url(
re_path(
r"^(?P<author_name>\w+)/(?P<toolchain_author_name>\w+)/(?P<toolchain_name>[-\w]+)/(?P<version>\d+)/(?P<name>[-\w]+)/share/$",
api.ShareExperimentView.as_view(),
name="share",
),
# Start
url(
re_path(
r"^(?P<author_name>\w+)/(?P<toolchain_author_name>\w+)/(?P<toolchain_name>[-\w]+)/(?P<version>\d+)/(?P<name>[-\w]+)/start/$",
api.StartExperimentView.as_view(),
name="start",
),
# Cancelling
url(
re_path(
r"^(?P<author_name>\w+)/(?P<toolchain_author_name>\w+)/(?P<toolchain_name>[-\w]+)/(?P<version>\d+)/(?P<name>[-\w]+)/cancel/$",
api.CancelExperimentView.as_view(),
name="cancel",
),
# Reseting
url(
re_path(
r"^(?P<author_name>\w+)/(?P<toolchain_author_name>\w+)/(?P<toolchain_name>[-\w]+)/(?P<version>\d+)/(?P<name>[-\w]+)/reset/$",
api.ResetExperimentView.as_view(),
name="reset",
),
# Attestations
url(
r"^(?P<attestation_number>\d+)/",
path(
"<int:attestation_number>/",
api.RetrieveExperimentResultsFromAttestationView.as_view(),
name="attestations",
),
# Experiments
url(
re_path(
r"^(?P<author_name>\w+)/$",
api.ListCreateExperimentsView.as_view(),
name="list_create",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<toolchain_author_name>\w+)/(?P<toolchain_name>[-\w]+)/(?P<version>\d+)/(?P<name>[-\w]+)/$",
api.RetrieveUpdateDestroyExperimentView.as_view(),
name="object",
......
......@@ -25,31 +25,32 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_libraries"
urlpatterns = [
url(r"^$", api.ListLibrariesView.as_view(), name="all"),
url(r"^check_name/$", api.CheckLibraryNameView.as_view(), name="check_name"),
url(
path("", api.ListLibrariesView.as_view(), name="all"),
path("check_name/", api.CheckLibraryNameView.as_view(), name="check_name"),
re_path(
r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
api.DiffLibraryView.as_view(),
name="diff",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<object_name>[-\w]+)/(?P<version>\d+)/share/$",
api.ShareLibraryView.as_view(),
name="share",
),
url(
re_path(
r"^(?P<author_name>\w+)/$",
api.ListCreateLibrariesView.as_view(),
name="list_create",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<object_name>[-\w]+)/(?P<version>\d+)/$",
api.RetrieveUpdateDestroyLibrariesView.as_view(),
name="object",
......
......@@ -25,56 +25,57 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_plotters"
urlpatterns = [
url(r"^$", api.ListPlotterView.as_view(), name="all"),
url(
path("", api.ListPlotterView.as_view(), name="all"),
re_path(
r"^format/(?P<author_name>\w+)/(?P<dataformat_name>[a-zA-Z0-9_\-]+)/(?P<version>\d+)/$",
api.ListFormatPlotterView.as_view(),
name="object",
),
url(
re_path(
r"^plotterparameters/(?P<author_name>\w+)/(?P<object_name>[a-zA-Z0-9_\-]+)/(?P<version>\d+)/share/$",
api.SharePlotterParameterView.as_view(),
name="share",
),
url(
re_path(
r"^plotterparameters/(?P<author_name>\w+)/(?P<object_name>[a-zA-Z0-9_\-]+)/(?P<version>\d+)/$",
api.RetrieveUpdateDestroyPlotterParametersView.as_view(),
name="view",
),
url(
re_path(
r"^plotterparameters/(?P<author_name>\w+)/$",
api.ListPlotterParametersView.as_view(),
name="view",
),
url(
r"^plotterparameters/$",
path(
"plotterparameters/",
api.ListPlotterParameterView.as_view(),
name="all_plotterparameter",
),
url(
re_path(
r"^plotterparameter/(?P<author_name>\w+)/(?P<dataformat_name>[a-zA-Z0-9_\-]+)/(?P<version>\d+)/$",
api.ListPlotterParameterView.as_view(),
name="plotterparameter",
),
url(
r"^defaultplotters/$",
path(
"defaultplotters/",
api.ListDefaultPlotterView.as_view(),
name="all_defaultplotters",
),
url(r"^check_name/$", api.CheckPlotterNameView.as_view(), name="check_name"),
url(
path("check_name/", api.CheckPlotterNameView.as_view(), name="check_name"),
re_path(
r"^(?P<author_name>\w+)/$",
api.ListCreatePlottersView.as_view(),
name="list_create",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<object_name>[-\w]+)/(?P<version>\d+)/$",
api.RetrieveUpdateDestroyPlottersView.as_view(),
name="object",
......
......@@ -25,60 +25,61 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_reports"
urlpatterns = [
url(
re_path(
r"^(?P<owner_name>\w+)/(?P<report_name>[\w\W]+)/rst/$",
api.ReportRSTCompileView.as_view(),
name="rst_compiler",
),
url(
r"^(?P<number>\d+)/rst/$",
path(
"<int:number>/rst/",
api.ReportRSTCompileAnonView.as_view(),
name="rst_compiler",
),
url(r"^$", api.ReportListView.as_view(), name="all"),
url(r"^(?P<number>\d+)/$", api.ReportDetailView.as_view(), name="object_report"),
url(r"^(?P<number>\d+)/results/$", api.ReportResultsView.as_view(), name="results"),
url(
path("", api.ReportListView.as_view(), name="all"),
path("<int:number>/", api.ReportDetailView.as_view(), name="object_report"),
path("<int:number>/results/", api.ReportResultsView.as_view(), name="results"),
re_path(
r"^(?P<owner_name>\w+)/(?P<report_name>[\w\W]+)/results_author/$",
api.ReportResultsAllExperimentsView.as_view(),
name="results",
),
url(
re_path(
r"^(?P<owner_name>\w+)/$", api.UserReportListView.as_view(), name="list_create"
),
url(
re_path(
r"^(?P<owner_name>\w+)/(?P<report_name>[\w\W]+)/add/$",
api.ReportAddExperimentsView.as_view(),
name="add_experiments",
),
url(
re_path(
r"^(?P<owner_name>\w+)/(?P<report_name>[\w\W]+)/remove/$",
api.ReportRemoveExperimentsView.as_view(),
name="remove_experiments",
),
url(
re_path(
r"^(?P<owner_name>\w+)/(?P<report_name>[\w\W]+)/lock/$",
api.LockReportView.as_view(),
name="lock",
),
url(
re_path(
r"^(?P<owner_name>\w+)/(?P<report_name>[\w\W]+)/publish/$",
api.PublishReportView.as_view(),
name="publish",
),
url(
re_path(
r"^(?P<owner_name>\w+)/(?P<report_name>[\w\W]+)/algorithms/$",
api.ReportAlgorithmsView.as_view(),
name="algorithms",
),
url(
re_path(
r"^(?P<owner_name>\w+)/(?P<report_name>[\w\W]+)/$",
api.ReportDetailView.as_view(),
name="object",
......
......@@ -25,31 +25,32 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_search"
urlpatterns = [
url(r"^$", api.SearchView.as_view(), name="all"),
url(
path("", api.SearchView.as_view(), name="all"),
re_path(
r"^save/(?P<author_name>\w+)/(?P<name>[\w\-]+)/$",
api.SearchSaveView.as_view(),
name="save",
),
url(r"^save/$", api.SearchSaveView.as_view(), name="save"),
url(
re_path("save/", api.SearchSaveView.as_view(), name="save"),
re_path(
r"^list/(?P<author_name>\w+)/$",
api.ListSearchView.as_view(),
name="list_for_author",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<object_name>[\w\-]+)/$",
api.RetrieveDestroySearchAPIView.as_view(),
name="object",
),
url(
re_path(
r"^share/(?P<author_name>\w+)/(?P<object_name>[\w\-]+)/$",
api.ShareSearchView.as_view(),
name="share",
......
......@@ -25,18 +25,19 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_teams"
urlpatterns = [
url(r"^$", api.TeamListView.as_view(), name="teamlist"),
url(
path("", api.TeamListView.as_view(), name="teamlist"),
re_path(
r"^(?P<owner_name>\w+)/$", api.UserTeamListView.as_view(), name="user_teamlist"
),
url(
re_path(
r"^(?P<owner_name>\w+)/(?P<team_name>[\w\W]+)/$",
api.TeamDetailView.as_view(),
name="team_info",
......
......@@ -25,26 +25,27 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import api
app_name = "api_toolchains"
urlpatterns = [
url(r"^$", api.ListToolchainView.as_view(), name="all"),
url(r"^check_name/$", api.CheckToolchainNameView.as_view(), name="check_name"),
url(
path("", api.ListToolchainView.as_view(), name="all"),
path("check_name/", api.CheckToolchainNameView.as_view(), name="check_name"),
re_path(
r"^(?P<author_name>\w+)/(?P<object_name>[-\w]+)/(?P<version>\d+)/share/$",
api.ShareToolchainView.as_view(),
name="share",
),
url(
re_path(
r"^(?P<author_name>\w+)/$",
api.ListCreateToolchainsView.as_view(),
name="list_create",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<object_name>[-\w]+)/(?P<version>\d+)/$",
api.RetrieveUpdateDestroyToolchainsView.as_view(),
name="object",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment