mirror of
https://github.com/AudebertAdrien/ft_transcendence.git
synced 2026-02-04 11:40:25 +01:00
beg epuration
This commit is contained in:
parent
9398124ed0
commit
d533167366
@ -2,7 +2,6 @@
|
||||
|
||||
from django.urls import path, include
|
||||
from . import views
|
||||
from .views import player_list, tournoi_list, match_list
|
||||
from rest_framework.routers import DefaultRouter
|
||||
from .views import match_list_json, player_list_json, tournoi_list_json
|
||||
|
||||
@ -13,9 +12,6 @@ urlpatterns = [
|
||||
path('register_user/', views.register_user, name='register_user'),
|
||||
path('authenticate_user/', views.authenticate_user, name='authenticate_user'),
|
||||
path('web3/', views.read_data, name='read_data'),
|
||||
path('players/', player_list, name='player_list'),
|
||||
path('matches/', match_list, name='match_list'),
|
||||
path('tournois/', tournoi_list, name='tournoi_list'),
|
||||
path('api/match_list/', match_list_json, name='match_list_json'),
|
||||
path('api/player_list/', player_list_json, name='player_list_json'),
|
||||
path('api/tournoi_list/', tournoi_list_json, name='tournoi_list_json')
|
||||
|
||||
@ -72,18 +72,6 @@ def get_or_create_token(user):
|
||||
|
||||
####################### THEOUCHE PART ############################
|
||||
|
||||
def player_list(request):
|
||||
players = Player.objects.all()
|
||||
return render(request, 'pong/player_list.html', {'players': players})
|
||||
|
||||
def match_list(request):
|
||||
matches = Match.objects.select_related('player1', 'player2', 'winner', 'tournoi').all()
|
||||
return render(request, 'pong/match_list.html', {'matches': matches})
|
||||
|
||||
def tournoi_list(request):
|
||||
tournois = Tournoi.objects.select_related('winner').all()
|
||||
return render(request, 'pong/tournoi_list.html', {'tournois': tournois})
|
||||
|
||||
from django.http import JsonResponse
|
||||
|
||||
def match_list_json(request):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user