old_contents: from manager import db
  
  class User(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      username = db.Column(db.String(64), unique=True)
      email = db.Column(db.String(120), unique=True)
      password = db.Column(db.String(256))
      enabled = db.Column(db.Boolean)
      superuser = db.Column(db.Boolean)
      openid_enabled = db.Column(db.Boolean)
  
      def is_authenticated():
          return True
  
      def is_active():
          return self.enabled
  
      def is_anonymous():
          return False
  
      def get_id():
          return self.id
  
new_contents: from manager import db
  from flask.ext.security import UserMixin, RoleMixin
  
  roles_users = db.Table('roles_users',
          db.Column('user_id', db.Integer(), db.ForeignKey('user.id')),
          db.Column('role_id', db.Integer(), db.ForeignKey('role.id')))
  
  class Role(db.Model, RoleMixin):
      id = db.Column(db.Integer(), primary_key=True)
      name = db.Column(db.String(80), unique=True)
      description = db.Column(db.String(255))
  
  class User(db.Model, UserMixin):
      id = db.Column(db.Integer, primary_key=True)
      username = db.Column(db.String(64), unique=True)
      email = db.Column(db.String(120), unique=True)
      password = db.Column(db.String(256))
      active = db.Column(db.Boolean)
      superuser = db.Column(db.Boolean)
      openid_enabled = db.Column(db.Boolean)
      confirmed_at = db.Column(db.DateTime())
      roles = db.relationship('Role', secondary=roles_users,
                              backref=db.backref('users', lazy='dynamic'))
  
      def is_authenticated():
          return True
  
      def is_active():
          return self.enabled
  
      def is_anonymous():
          return False
  
      def get_id():
          return self.id
  
subject: Set up flask-security