from app import db class EntityBase(object): def to_json(self): fields = self.__dict__ if "_sa_instance_state" in fields: del fields["_sa_instance_state"] return fields class School(db.Model, EntityBase): """ 表名,字段名 """ __tablename__ = "school_list" id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(255)) province = db.Column(db.String(255)) city = db.Column(db.String(255)) feature = db.Column(db.String(255)) hotValue = db.Column(db.String(255)) pic = db.Column(db.String(255)) category = db.Column(db.String(255)) batchTimes = db.Column(db.String(255))