Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PizzaWeb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sofiane Lasri
PizzaWeb
Commits
481f5a7b
Commit
481f5a7b
authored
2 years ago
by
Sofiane Lasri
Browse files
Options
Downloads
Patches
Plain Diff
TP3 terminé
parent
3365b168
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
webpizza/applipizza/templates/applipizza/pizzas.html
+32
-0
32 additions, 0 deletions
webpizza/applipizza/templates/applipizza/pizzas.html
webpizza/applipizza/views.py
+8
-0
8 additions, 0 deletions
webpizza/applipizza/views.py
webpizza/webpizza/urls.py
+2
-0
2 additions, 0 deletions
webpizza/webpizza/urls.py
with
42 additions
and
0 deletions
webpizza/applipizza/templates/applipizza/pizzas.html
0 → 100644
+
32
−
0
View file @
481f5a7b
<!DOCTYPE html>
<html
lang=
"fr"
>
<head>
<meta
charset=
"utf-8"
>
<title>
Les pizzas
</title>
</head>
<body>
<header>
<nav>
<div>
<a
href=
"/pizzas/"
>
Les pizzas
</a>
</div>
<div>
<a
href=
"/ingredients/"
>
Les ingrédients
</a>
</div>
</nav>
</header>
<main>
<h2>
Voici nos {{ pizzas|length }} pizzas
</h2>
<ul>
{% for p in pizzas %}
<li>
<a
href=
"/pizzas/{{ p.id }}"
>
{{ p.nom }}
</a>
- {{ p.prix }} €
</li>
{% endfor %}
</ul>
</main>
<footer>
<p>
© Pizza Corp - Tous droits réservés
</p>
</footer>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
webpizza/applipizza/views.py
+
8
−
0
View file @
481f5a7b
from
django.shortcuts
import
render
from
applipizza.models
import
Pizza
,
Ingredient
,
Composition
# Create your views here.
def
pizzas
(
request
):
pizzas
=
Pizza
.
objects
.
all
()
return
render
(
request
,
'
applipizza/pizzas.html
'
,
{
'
pizzas
'
:
pizzas
}
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
webpizza/webpizza/urls.py
+
2
−
0
View file @
481f5a7b
...
...
@@ -16,7 +16,9 @@ Including another URLconf
"""
from
django.contrib
import
admin
from
django.urls
import
path
from
applipizza
import
views
urlpatterns
=
[
path
(
'
admin/
'
,
admin
.
site
.
urls
),
path
(
'
pizzas/
'
,
views
.
pizzas
)
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment