Commit 325235a7 by bricioso

feat: adicionando models.py

parent 253bae18
from flask import Flask from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__) # Inicializa o banco de dados
db = SQLAlchemy()
if __name__ == "__main__": class Animal(db.Model):
app.run(debug=True) __tablename__ = 'animais'
\ No newline at end of file
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment