Commit f9482e0d authored by Samuel GAIST's avatar Samuel GAIST

[urls] Migrate to new Django style using path

parent 60b19050
Pipeline #43206 passed with stage
in 15 minutes and 58 seconds
...@@ -25,20 +25,21 @@ ...@@ -25,20 +25,21 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from django.urls import re_path
from . import views from . import views
app_name = "accounts" app_name = "accounts"
urlpatterns = [ urlpatterns = [
url(r"^settings/$", views.account_settings, name="settings"), path("settings/", views.account_settings, name="settings"),
url( re_path(
r"^validation/(?P<hash_url>\w+)/$", r"^validation/(?P<hash_url>\w+)/$",
views.load_temporary_url_validation, views.load_temporary_url_validation,
name="temp_url_validation", name="temp_url_validation",
), ),
url( re_path(
r"^rejection/(?P<hash_url>\w+)/$", r"^rejection/(?P<hash_url>\w+)/$",
views.load_temporary_url_rejection, views.load_temporary_url_rejection,
name="temp_url_rejection", name="temp_url_rejection",
......
...@@ -25,38 +25,38 @@ ...@@ -25,38 +25,38 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from django.urls import re_path
from . import views from . import views
app_name = "algorithms" app_name = "algorithms"
urlpatterns = [ urlpatterns = [
url(r"^new/$", views.create, name="new",), path("new/", views.create, name="new",),
url(r"^update/(?P<name>[-\w]+)/$", views.create, name="new-version",), re_path(r"^update/(?P<name>[-\w]+)/$", views.create, name="new-version",),
url(r"^$", views.public_ls, name="public-list",), path("", views.public_ls, name="public-list",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",), re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
url( re_path(
r"^fork/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$", r"^fork/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.fork, views.fork,
name="fork", name="fork",
), ),
url( re_path(
r"^edit/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$", r"^edit/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.edit, views.edit,
name="edit", name="edit",
), ),
url( re_path(
r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$", r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
views.diff, views.diff,
name="diff", name="diff",
), ),
url(r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",), re_path(r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",),
url( re_path(
r"^(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$", r"^(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.view, views.view,
name="view", name="view",
), ),
url(r"^$", views.public_ls, name="public-list",), re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
] ]
...@@ -25,14 +25,15 @@ ...@@ -25,14 +25,15 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from django.urls import re_path
from . import views from . import views
app_name = "attestations" app_name = "attestations"
urlpatterns = [ urlpatterns = [
url(r"^$", views.public_ls, name="public-list",), path("", views.public_ls, name="public-list",),
url(r"^(?P<number>\d+)/$", views.view, name="view",), path("<int:number>/", views.view, name="view",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",), re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
] ]
...@@ -25,24 +25,23 @@ ...@@ -25,24 +25,23 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from django.urls import re_path
from . import views from . import views
app_name = "backend" app_name = "backend"
urlpatterns = [ urlpatterns = [
url(r"^scheduler/$", views.scheduler, name="scheduler",), path("scheduler/", views.scheduler, name="scheduler",),
url( path(
r"^cancel-experiments/$", "cancel-experiments/", views.cancel_all_experiments, name="cancel-experiments",
views.cancel_all_experiments,
name="cancel-experiments",
), ),
url(r"^update-workers/$", views.update_workers, name="update-workers",), path("update-workers/", views.update_workers, name="update-workers",),
url( re_path(
r"^environments/(?P<name>[-\.\w\s+]+)/(?P<version>[-\.\w]+)/$", r"^environments/(?P<name>[-\.\w\s+]+)/(?P<version>[-\.\w]+)/$",
views.environment, views.environment,
name="view-environment", name="view-environment",
), ),
url(r"^environments/$", views.list_environments, name="list-environments",), path("environments/", views.list_environments, name="list-environments",),
] ]
...@@ -25,14 +25,15 @@ ...@@ -25,14 +25,15 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from django.urls import re_path
from . import views from . import views
app_name = "databases" app_name = "databases"
urlpatterns = [ urlpatterns = [
url(r"^$", views.ls, name="list",), path(r"", views.ls, name="list",),
url(r"^(?P<name>[-\w]+)/(?P<version>\d+)/$", views.view, name="view"), re_path(r"^(?P<name>[-\w]+)/(?P<version>\d+)/$", views.view, name="view"),
url(r"^(?P<name>[-\w]+)/$", views.view, name="view-latest",), re_path(r"^(?P<name>[-\w]+)/$", views.view, name="view-latest",),
] ]
...@@ -25,36 +25,37 @@ ...@@ -25,36 +25,37 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from django.urls import re_path
from . import views from . import views
app_name = "dataformats" app_name = "dataformats"
urlpatterns = [ urlpatterns = [
url(r"^new/$", views.create, name="new",), path("new/", views.create, name="new",),
url(r"^update/(?P<name>[-\w]+)/$", views.create, name="new-version",), re_path(r"^update/(?P<name>[-\w]+)/$", views.create, name="new-version",),
url(r"^$", views.public_ls, name="public-list",), path("", views.public_ls, name="public-list",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",), re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
url( re_path(
r"^fork/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$", r"^fork/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.fork, views.fork,
name="fork", name="fork",
), ),
url( re_path(
r"^edit/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$", r"^edit/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.edit, views.edit,
name="edit", name="edit",
), ),
url( re_path(
r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$", r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
views.diff, views.diff,
name="diff", name="diff",
), ),
url( re_path(
r"^(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$", r"^(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.view, views.view,
name="view", name="view",
), ),
url(r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",), re_path(r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",),
] ]
...@@ -25,33 +25,34 @@ ...@@ -25,33 +25,34 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from django.urls import re_path
from . import views from . import views
app_name = "experiments" app_name = "experiments"
urlpatterns = [ urlpatterns = [
url( re_path(
r"^setup/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/$", r"^setup/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/$",
views.new_from_toolchain, views.new_from_toolchain,
name="new-from-toolchain", name="new-from-toolchain",
), ),
url( re_path(
r"^reset/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/(?P<name>[-\w]+)/$", r"^reset/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/(?P<name>[-\w]+)/$",
views.reset, views.reset,
name="reset", name="reset",
), ),
url( re_path(
r"^fork/(?P<author_name>\w+)/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/(?P<name>[-\w]+)/$", r"^fork/(?P<author_name>\w+)/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/(?P<name>[-\w]+)/$",
views.fork, views.fork,
name="fork", name="fork",
), ),
url( re_path(
r"^(?P<author_name>\w+)/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/(?P<name>[-\w]+)/$", r"^(?P<author_name>\w+)/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/(?P<name>[-\w]+)/$",
views.view, views.view,
name="view", name="view",
), ),
url(r"^$", views.public_ls, name="public-list",), path("", views.public_ls, name="public-list",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",), re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
] ]
...@@ -25,36 +25,39 @@ ...@@ -25,36 +25,39 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from django.urls import re_path
from . import views from . import views
app_name = "libraries" app_name = "libraries"
urlpatterns = [ urlpatterns = [
url(r"^new/$", views.create, name="new",), path("new/", views.create, name="new",),
url(r"^update/(?P<name>[-\w]+)/$", views.new_version, name="new-version",), re_path(r"^update/(?P<name>[-\w]+)/$", views.new_version, name="new-version",),
url( re_path(
r"^fork/(?P<author_name>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$", r"^fork/(?P<author_name>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.fork, views.fork,
name="fork", name="fork",
), ),
url( re_path(
r"^edit/(?P<author_name>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$", r"^edit/(?P<author_name>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.edit, views.edit,
name="edit", name="edit",
), ),
url( re_path(
r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$", r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
views.diff, views.diff,
name="diff", name="diff",
), ),
url( re_path(
r"^(?P<author_name>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$", r"^(?P<author_name>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.view, views.view,
name="view", name="view",
), ),
url(r"^(?P<author_name>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",), re_path(
url(r"^$", views.public_ls, name="public-list",), r"^(?P<author_name>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",), ),
path("", views.public_ls, name="public-list",),
re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
] ]
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r"^tos/$", views.terms_of_service, name="terms-of-service",), path("tos/", views.terms_of_service, name="terms-of-service",),
url(r"^disclaimer/$", views.legal_disclaimer, name="legal-disclaimer",), path("disclaimer/", views.legal_disclaimer, name="legal-disclaimer",),
url(r"^contact/$", views.contact, name="contact",), path("contact/", views.contact, name="contact",),
] ]
...@@ -25,8 +25,9 @@ ...@@ -25,8 +25,9 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import include from django.urls import include
from django.conf.urls import url from django.urls import path
from django.urls import re_path
from . import views from . import views
...@@ -34,21 +35,21 @@ app_name = "plotters" ...@@ -34,21 +35,21 @@ app_name = "plotters"
partial_patterns = ( partial_patterns = (
[ [
url( path(
r"^plotinfo/$", "plotinfo",
views.PartialGroupView.as_view( views.PartialGroupView.as_view(
template_name="plotterparameters/partials/plotgraphicinfo.html", template_name="plotterparameters/partials/plotgraphicinfo.html",
), ),
name="plotinfo", name="plotinfo",
), ),
url( path(
r"^plotparamsinfo/$", "plotparamsinfo/",
views.PartialGroupView.as_view( views.PartialGroupView.as_view(
template_name="plotterparameters/partials/plotparamsinfo.html", template_name="plotterparameters/partials/plotparamsinfo.html",
), ),
name="plotinfo", name="plotinfo",
), ),
url( re_path(
r"^(?P<template_name>[a-zA-Z_]+\.html)$", views.PartialGroupView.as_view(), r"^(?P<template_name>[a-zA-Z_]+\.html)$", views.PartialGroupView.as_view(),
), ),
], ],
...@@ -56,61 +57,61 @@ partial_patterns = ( ...@@ -56,61 +57,61 @@ partial_patterns = (
) )
urlpatterns = [ urlpatterns = [
url(r"^partials/", include(partial_patterns),), path("partials/", include(partial_patterns),),
url(r"^$", views.list_plotters, name="list",), path("", views.list_plotters, name="list",),
url(r"^plot/$", views.plot, name="plot",), path("plot/", views.plot, name="plot",),
url(r"^plot_sample/$", views.plot_sample, name="plot_sample",), path("plot_sample/", views.plot_sample, name="plot_sample",),
url( path(
r"^plot_sample_with_params/$", "plot_sample_with_params/",
views.plot_sample_with_params, views.plot_sample_with_params,
name="plot_sample_with_params", name="plot_sample_with_params",
), ),
url( re_path(
r"^plotterparameter/(?P<author_name>\w+)/new_plotterparameter/$", r"^plotterparameter/(?P<author_name>\w+)/new_plotterparameter/$",
views.create_plotterparameter, views.create_plotterparameter,
name="new_plotterparameter", name="new_plotterparameter",
), ),
url( re_path(
r"^plotterparameter/(?P<author_name>\w+)/(?P<plotterparameter_name>[-\w]+)/(?P<version>\d+)/new/$", r"^plotterparameter/(?P<author_name>\w+)/(?P<plotterparameter_name>[-\w]+)/(?P<version>\d+)/new/$",
views.create_new_version, views.create_new_version,
name="new-version", name="new-version",
), ),
url( re_path(
r"^plotterparameter/(?P<author_name>\w+)/(?P<plotterparameter_name>[-\w]+)/(?P<version>\d+)/fork/$", r"^plotterparameter/(?P<author_name>\w+)/(?P<plotterparameter_name>[-\w]+)/(?P<version>\d+)/fork/$",
views.fork, views.fork,
name="fork", name="fork",
), ),
url( re_path(
r"^plotterparameter/diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$", r"^plotterparameter/diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
views.diff, views.diff,
name="diff", name="diff",
), ),
url( re_path(
r"^(?P<author_name>\w+)/plotterparameter/$", r"^(?P<author_name>\w+)/plotterparameter/$",
views.list_plotterparameters, views.list_plotterparameters,
name="plotterparameter-list", name="plotterparameter-list",
), ),
url( path(
r"^plotterparameter/$", "plotterparameter/",
views.list_plotterparameters_public, views.list_plotterparameters_public,
name="plotterparameter-public-list", name="plotterparameter-public-list",
), ),
url( re_path(
r"^plotterparameter/(?P<author_name>\w+)/(?P<plotterparameter_name>[-\w]+)/(?P<version>\d+)/$", r"^plotterparameter/(?P<author_name>\w+)/(?P<plotterparameter_name>[-\w]+)/(?P<version>\d+)/$",
views.plotterparameter_for_author, views.plotterparameter_for_author,
name="plotterparameter-author-view", name="plotterparameter-author-view",
), ),
url( re_path(
r"^(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$", r"^(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.view, views.view,
name="view", name="view",
), ),
url( re_path(
r"^plotterparameter/(?P<author>\w+)/(?P<name>[-\w]+)/$", r"^plotterparameter/(?P<author>\w+)/(?P<name>[-\w]+)/$",
views.plotterparameter_latest, views.plotterparameter_latest,
name="plotterparameter-view-latest", name="plotterparameter-view-latest",
), ),
url( re_path(
r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="plotter-view-latest", r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="plotter-view-latest",
), ),
] ]
...@@ -25,22 +25,25 @@ ...@@ -25,22 +25,25 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from django.urls import re_path
from . import views from . import views
app_name = "reports" app_name = "reports"
partial_patterns = [ partial_patterns = [
url(r"^(?P<template_name>[a-zA-Z_]+\.html)$", views.PartialGroupView.as_view(),), re_path(
r"^(?P<template_name>[a-zA-Z_]+\.html)$", views.PartialGroupView.as_view(),
),
] ]
urlpatterns = [ urlpatterns = [
url(r"^$", views.public_ls, name="public-list",), path("", views.public_ls, name="public-list",),
url(r"^(?P<number>\d+)/$", views.by_number, name="view",), path("<int:number>/", views.by_number, name="view",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",), re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
url( re_path(
r"^(?P<author_name>\w+)/(?P<report_name>[-\w]+)/$", r"^(?P<author_name>\w+)/(?P<report_name>[-\w]+)/$",
views.for_author, views.for_author,
name="author-view", name="author-view",
......
...@@ -25,18 +25,21 @@ ...@@ -25,18 +25,21 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from django.urls import re_path
from . import views from . import views
app_name = "search" app_name = "search"
urlpatterns = [ urlpatterns = [
url(r"^$", views.public_ls, name="public-list",), path(r"", views.public_ls, name="public-list",),
url(r"^run/$", views.search, name="search",), path(r"run/", views.search, name="search",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",), re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
url(r"^(?P<author_name>\w+)/(?P<query_name>[\w\-]+)/$", views.view, name="view",), re_path(
url( r"^(?P<author_name>\w+)/(?P<query_name>[\w\-]+)/$", views.view, name="view",
),
re_path(
r"^(?P<author_name>\w+)/(?P<query_name>[\w\-]+)/notify/$", r"^(?P<author_name>\w+)/(?P<query_name>[\w\-]+)/notify/$",
views.notify, views.notify,
name="notify", name="notify",
......
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
# # # #
############################################################################### ###############################################################################
from django.conf.urls import url from django.urls import path
from . import views from . import views