时间:2021-07-01 10:21:17 帮助过:185人阅读
class Role(db.Model): __tablename__ = ‘roles‘ id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String, nullable=True) users = db.relationship(‘User‘, backref=True) class User(db.Model): __tablename__ = ‘users‘ id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String, nullable=True) password = db.Column(db.String, devnull=True) role_id = db.Column(db.Integer,db.ForeignKey(‘roles.id‘))
Flask入门之SQLAlchemy配置与数据库连接
标签:mit log _id code .sql ons color mod uri