models.py 474 B

123456789101112131415161718192021
  1. # coding: utf-8
  2. from sqlalchemy import Column, DateTime, Integer, Numeric, String
  3. from flask_sqlalchemy import SQLAlchemy
  4. #與當前項目相關的模型文件,即所有的實體類在此編寫
  5. from manage import db
  6. #管理者表
  7. class User(db.Model):
  8. __tablename__ = 'user'
  9. sn = db.Column(db.Integer, primary_key=True)
  10. username = db.Column(db.String(30), nullable=False, unique=True)
  11. password = db.Column(db.Text, nullable=False)
  12. #db.create_all()