Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
projeto-integrador-crud-fazenda
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
2024105070039
projeto-integrador-crud-fazenda
Commits
bb4b23e6
Commit
bb4b23e6
authored
Apr 16, 2026
by
Tiago da Silva Sabaini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Primeiro Commit
parent
d065ee68
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
0 deletions
+26
-0
app.py
templates/app.py
+15
-0
index.html
templates/index.html
+0
-0
model.py
templates/model.py
+11
-0
static.css
templates/static.css
+0
-0
No files found.
templates/app.py
0 → 100644
View file @
bb4b23e6
from
flask
import
Flask
,
render_template
,
request
,
redirect
from
models
import
db
,
Animal
app
=
Flask
(
__name__
)
app
.
config
[
'SQLALCHEMY_DATABASE_URI'
]
=
'sqlite:///fazenda.db'
db
.
init_app
(
app
)
with
app
.
app_context
():
db
.
create_all
()
# Cria o arquivo do banco automaticamente
@app.route
(
'/'
)
def
index
():
lista
=
Animal
.
query
.
all
()
return
render_template
(
'index.html'
,
animais
=
lista
)
\ No newline at end of file
templates/index.html
0 → 100644
View file @
bb4b23e6
templates/model.py
0 → 100644
View file @
bb4b23e6
from
flask_sqlalchemy
import
SQLAlchemy
db
=
SQLAlchemy
()
class
Animal
(
db
.
Model
):
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
nome
=
db
.
Column
(
db
.
String
(
50
),
nullable
=
False
)
especie
=
db
.
Column
(
db
.
String
(
50
),
nullable
=
False
)
idade
=
db
.
Column
(
db
.
Integer
)
peso
=
db
.
Column
(
db
.
Float
)
\ No newline at end of file
templates/static.css
0 → 100644
View file @
bb4b23e6
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