Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
Dishly
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
O Bar da Lora
Dishly
Commits
a80c2760
Commit
a80c2760
authored
May 07, 2026
by
Natã Frederico Sangalletti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Função excluir
parent
a5664ca4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
0 deletions
+11
-0
app.py
app/app.py
+7
-0
cadastro.html
templates/cadastro.html
+1
-0
editar.html
templates/editar.html
+2
-0
index.html
templates/index.html
+1
-0
No files found.
app/app.py
View file @
a80c2760
...
@@ -40,6 +40,13 @@ def editar(id):
...
@@ -40,6 +40,13 @@ def editar(id):
return
redirect
(
url_for
(
'index'
))
return
redirect
(
url_for
(
'index'
))
return
render_template
(
'editar.html'
,
receita
=
receita
)
return
render_template
(
'editar.html'
,
receita
=
receita
)
@app.route
(
'/excluir/<int:id>'
)
def
excluir
(
id
):
receita
=
Receita
.
query
.
get_or_404
(
id
)
db
.
session
.
delete
(
receita
)
db
.
session
.
commit
()
return
redirect
(
url_for
(
'index'
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
with
app
.
app_context
():
with
app
.
app_context
():
db
.
create_all
()
db
.
create_all
()
...
...
templates/cadastro.html
View file @
a80c2760
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<head>
<head>
<meta
charset=
"UTF-8"
>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<link
rel=
"stylesheet"
href=
"/static/style.css"
>
<title>
Cadastro
</title>
<title>
Cadastro
</title>
</head>
</head>
<body>
<body>
...
...
templates/editar.html
View file @
a80c2760
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<head>
<head>
<meta
charset=
"UTF-8"
>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<link
rel=
"stylesheet"
href=
"/static/style.css"
>
<title>
Editar Receita
</title>
<title>
Editar Receita
</title>
</head>
</head>
<body>
<body>
...
@@ -12,6 +13,7 @@
...
@@ -12,6 +13,7 @@
<input
id=
"nome"
name=
"nome"
type=
"text"
value=
"{{ receita.nome }}"
required
>
<input
id=
"nome"
name=
"nome"
type=
"text"
value=
"{{ receita.nome }}"
required
>
<button
type=
"reset"
>
Limpar
</button>
<button
type=
"reset"
>
Limpar
</button>
<button
type=
"submit"
>
Salvar
</button>
<button
type=
"submit"
>
Salvar
</button>
<button
type=
"button"
onclick=
"location.href='/excluir/{{ receita.id }}'"
>
Excluir
</button>
</form>
</form>
</div>
</div>
</body>
</body>
...
...
templates/index.html
View file @
a80c2760
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<head>
<head>
<meta
charset=
"UTF-8"
>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<link
rel=
"stylesheet"
href=
"/static/style.css"
>
<title>
Dishly
</title>
<title>
Dishly
</title>
</head>
</head>
<body>
<body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment