class Setting(Base): """base setting model""" __abstract__ = True name = db.Column(db.String(100)) label = db.Column(db.String(100)) description = db.Column(db.Text) value = db.Column(db.Text) type = db.Column(db.String(50)) toggable = db.Column(db.Boolean, default=True)
class Role(Base): """base role model (<- hahaha. punny)""" __abstract__ = True name = db.Column(db.String(100)) permissions = db.Column(db.Text) def all_permissions(self): return [s.strip() for s in self.permissions.split(',')]