Spaces:
Runtime error
Runtime error
from flask_sqlalchemy import SQLAlchemy | |
from uuid import uuid4 | |
db = SQLAlchemy() | |
def get_uuid(): | |
return uuid4().hex | |
class UserModal(db.Model): | |
__tablename__ = 'users' | |
id = db.Column(db.String(32), primary_key=True, unique=True, default=get_uuid) | |
email = db.Column(db.String(120), unique=True, nullable=False) | |
password = db.Column(db.String(60), nullable=False) | |
def __repr__(self): | |
return f"User('{self.username}', '{self.email}')" | |