Sort url paths

This commit is contained in:
Lukáš Kucharczyk 2024-06-03 18:18:58 +02:00
parent 15997bd5af
commit cd804f2c77
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
2 changed files with 40 additions and 40 deletions

View File

@ -4,14 +4,36 @@ from games import views
urlpatterns = [ urlpatterns = [
path("", views.index, name="index"), path("", views.index, name="index"),
path("device/add", views.add_device, name="add_device"),
path("edition/add", views.add_edition, name="add_edition"),
path( path(
"session/list/recent", "edition/add/for-game/<int:game_id>",
views.list_sessions, views.add_edition,
{"filter": "recent"}, name="add_edition_for_game",
name="list_sessions_recent",
), ),
path("edition/<int:edition_id>/edit", views.edit_edition, name="edit_edition"),
path("game/add", views.add_game, name="add_game"), path("game/add", views.add_game, name="add_game"),
path("game/<int:game_id>/edit", views.edit_game, name="edit_game"),
path("game/<int:game_id>/view", views.view_game, name="view_game"),
path("platform/add", views.add_platform, name="add_platform"), path("platform/add", views.add_platform, name="add_platform"),
path("platform/<int:platform_id>/edit", views.edit_platform, name="edit_platform"),
path("purchase/add", views.add_purchase, name="add_purchase"),
path("purchase/<int:purchase_id>/edit", views.edit_purchase, name="edit_purchase"),
path(
"purchase/<int:purchase_id>/delete",
views.delete_purchase,
name="delete_purchase",
),
path(
"purchase/related-purchase-by-edition",
views.related_purchase_by_edition,
name="related_purchase_by_edition",
),
path(
"purchase/add/for-edition/<int:edition_id>",
views.add_purchase,
name="add_purchase_for_edition",
),
path("session/add", views.add_session, name="add_session"), path("session/add", views.add_session, name="add_session"),
path( path(
"session/add/for-purchase/<int:purchase_id>", "session/add/for-purchase/<int:purchase_id>",
@ -30,6 +52,12 @@ urlpatterns = [
{"template": "list_sessions.html#session-row"}, {"template": "list_sessions.html#session-row"},
name="list_sessions_start_session_from_session", name="list_sessions_start_session_from_session",
), ),
path("session/<int:session_id>/edit", views.edit_session, name="edit_session"),
path(
"session/<int:session_id>/delete",
views.delete_session,
name="delete_session",
),
path( path(
"session/end/from-game/<int:session_id>", "session/end/from-game/<int:session_id>",
views.end_session, views.end_session,
@ -42,41 +70,13 @@ urlpatterns = [
{"template": "list_sessions.html#session-row"}, {"template": "list_sessions.html#session-row"},
name="list_sessions_end_session", name="list_sessions_end_session",
), ),
path(
"session/<int:session_id>/delete",
views.delete_session,
name="delete_session",
),
path(
"purchase/<int:purchase_id>/delete",
views.delete_purchase,
name="delete_purchase",
),
path("purchase/add", views.add_purchase, name="add_purchase"),
path(
"purchase/add/for-edition/<int:edition_id>",
views.add_purchase,
name="add_purchase_for_edition",
),
path(
"related-purchase-by-edition",
views.related_purchase_by_edition,
name="related_purchase_by_edition",
),
path("edition/add", views.add_edition, name="add_edition"),
path(
"edition/add/for-game/<int:game_id>",
views.add_edition,
name="add_edition_for_game",
),
path("edition/<int:edition_id>/edit", views.edit_edition, name="edit_edition"),
path("game/<int:game_id>/view", views.view_game, name="view_game"),
path("game/<int:game_id>/edit", views.edit_game, name="edit_game"),
path("platform/<int:platform_id>/edit", views.edit_platform, name="edit_platform"),
path("device/add", views.add_device, name="add_device"),
path("session/<int:session_id>/edit", views.edit_session, name="edit_session"),
path("purchase/<int:purchase_id>/edit", views.edit_purchase, name="edit_purchase"),
path("session/list", views.list_sessions, name="list_sessions"), path("session/list", views.list_sessions, name="list_sessions"),
path(
"session/list/recent",
views.list_sessions,
{"filter": "recent"},
name="list_sessions_recent",
),
path( path(
"session/list/by-purchase/<int:purchase_id>", "session/list/by-purchase/<int:purchase_id>",
views.list_sessions, views.list_sessions,

View File

@ -23,10 +23,10 @@ from graphene_django.views import GraphQLView
urlpatterns = [ urlpatterns = [
path("", RedirectView.as_view(url="/tracker")), path("", RedirectView.as_view(url="/tracker")),
path("graphql", csrf_exempt(GraphQLView.as_view(graphiql=True))),
path("login/", auth_views.LoginView.as_view(), name="login"), path("login/", auth_views.LoginView.as_view(), name="login"),
path("logout/", auth_views.LogoutView.as_view(), name="logout"), path("logout/", auth_views.LogoutView.as_view(), name="logout"),
path("tracker/", include("games.urls")), path("tracker/", include("games.urls")),
path("graphql", csrf_exempt(GraphQLView.as_view(graphiql=True))),
] ]
if settings.DEBUG: if settings.DEBUG: