Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crud-animais-fazenda
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
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
Nicoly Aparecida Lopes
crud-animais-fazenda
Commits
5b6cbd98
Commit
5b6cbd98
authored
Apr 16, 2026
by
Beatryz Chagas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beatryz
parent
ce4f9f3e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
21 deletions
+2
-21
app.py
app.py
+2
-21
No files found.
app.py
View file @
5b6cbd98
...
...
@@ -9,27 +9,8 @@ db.init_app(app)
with
app
.
app_context
():
db
.
create_all
()
# LISTAR (página inicial)
# BEATRYZ — LISTAR
@app.route
(
'/'
)
def
index
():
animais
=
Animal
.
query
.
all
()
return
render_template
(
'index.html'
,
animais
=
animais
)
\ No newline at end of file
# EDITAR (Nicoly)
@app.route
(
'/editar/<int:id>'
,
methods
=
[
'GET'
,
'POST'
])
def
editar
(
id
):
animal
=
Animal
.
query
.
get
(
id
)
if
request
.
method
==
'POST'
:
animal
.
nome
=
request
.
form
[
'nome'
]
animal
.
especie
=
request
.
form
[
'especie'
]
animal
.
idade
=
int
(
request
.
form
[
'idade'
])
animal
.
peso
=
float
(
request
.
form
[
'peso'
])
db
.
session
.
commit
()
return
redirect
(
'/'
)
return
render_template
(
'editar.html'
,
animal
=
animal
)
if
__name__
==
'__main__'
:
app
.
run
(
debug
=
True
)
\ No newline at end of file
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