From e317fbc90ed6523bb18016df5ee9be0e2f21a42d Mon Sep 17 00:00:00 2001 From: Harouna Diallo Date: Mon, 26 Jul 2021 07:06:41 +0000 Subject: [PATCH] test reverse to user tutoriel guide --- examples/awesome_app/app/views.py | 8 ++------ .../awesome_app/templates/awesome_app/detail_film.html | 2 +- .../awesome_app/templates/awesome_app/list_films.html | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/awesome_app/app/views.py b/examples/awesome_app/app/views.py index 012413d..a59b911 100644 --- a/examples/awesome_app/app/views.py +++ b/examples/awesome_app/app/views.py @@ -43,11 +43,7 @@ }, ] -@router('/') -def home(request): - return render('awesome_app/home.html') - -@router('/films') +@router('/', name='home') def home(request): search = request.GET.get('search', '') films_filter = [ @@ -61,7 +57,7 @@ def home(request): } return render('awesome_app/list_films.html', contexts) -@router('/films/', methods=['GET', 'POST']) +@router('/films/', methods=['GET', 'POST'], name='film') def film_detail(request, id): film = { 'data': film for film in films if film['id'] == id diff --git a/examples/awesome_app/templates/awesome_app/detail_film.html b/examples/awesome_app/templates/awesome_app/detail_film.html index c429dc2..10c8baf 100644 --- a/examples/awesome_app/templates/awesome_app/detail_film.html +++ b/examples/awesome_app/templates/awesome_app/detail_film.html @@ -37,7 +37,7 @@
- Back to list + Back to list

{{ film.title }}

{{ film.description }} diff --git a/examples/awesome_app/templates/awesome_app/list_films.html b/examples/awesome_app/templates/awesome_app/list_films.html index d472386..8a737dd 100644 --- a/examples/awesome_app/templates/awesome_app/list_films.html +++ b/examples/awesome_app/templates/awesome_app/list_films.html @@ -25,7 +25,7 @@

List films

{{ film.title }}

Year of production : {{ film.released }}