-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
25 lines (22 loc) · 922 Bytes
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
nome_completo = db.Column(db.String(100), nullable=False)
idade = db.Column(db.Integer)
genero = db.Column(db.String(10))
endereco = db.relationship('Endereco', backref='user', uselist=False)
email = db.Column(db.String(100), unique=True)
telefone = db.Column(db.String(20))
cpf = db.Column(db.String(14))
documento = db.Column(db.String(100))
data_nascimento = db.Column(db.Date)
senha = db.Column(db.String(100))
# Adicione mais campos conforme necessário
class Endereco(db.Model):
id = db.Column(db.Integer, primary_key=True)
rua = db.Column(db.String(100))
numero = db.Column(db.String(20))
cidade = db.Column(db.String(50))
estado = db.Column(db.String(20))
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))