core: recreation of tournament view by using

queryset
This commit is contained in:
2023-12-20 21:09:31 +01:00
parent 9714918de9
commit 1032a8fd98
3 changed files with 47 additions and 30 deletions

View File

@ -1,10 +1,10 @@
from django.urls import path
from django.urls import path, re_path
from django.conf import settings
from django.conf.urls.static import static
from .views import TournamentsView, TournamentView
from .viewset import TournamentViewSet
urlpatterns = [
path("<int:pk>", name="tournament_page"),
path("", TournamentsView.as_view(), name="tournaments"),
path("<int:pk>", TournamentViewSet.as_view({"get": "retrieve", "post": "create"}), name="tournament_page"),
re_path(r"(<str:state>)?", TournamentViewSet.as_view({"get": "list"}), name="tournaments"),
]