Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CRUD_Animais_da_Fazenda
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
7
Issues
7
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
Hiago Rafael
CRUD_Animais_da_Fazenda
Commits
325235a7
You need to sign in or sign up before continuing.
Commit
325235a7
authored
Apr 16, 2026
by
bricioso
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: adicionando models.py
parent
253bae18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
models.py
app.py/models.py
+15
-5
No files found.
app.py/models.py
View file @
325235a7
from
flask
import
Flask
from
flask
_sqlalchemy
import
SQLAlchemy
app
=
Flask
(
__name__
)
# Inicializa o banco de dados
db
=
SQLAlchemy
()
if
__name__
==
"__main__"
:
app
.
run
(
debug
=
True
)
\ No newline at end of file
class
Animal
(
db
.
Model
):
__tablename__
=
'animais'
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
nome
=
db
.
Column
(
db
.
String
(
100
),
nullable
=
False
)
especie
=
db
.
Column
(
db
.
String
(
50
),
nullable
=
False
)
idade
=
db
.
Column
(
db
.
Integer
,
nullable
=
False
)
peso
=
db
.
Column
(
db
.
Float
,
nullable
=
False
)
def
__repr__
(
self
):
return
f
'<Animal {self.nome}>'
\ 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