text: from sqlalchemy.sql import func
  from project import db
  
  
  class User(db.Model):
  
      __tablename__ = "users"
  
      id = db.Column(db.Integer, primary_key=True, autoincrement=True)
      username = db.Column(db.String(32), nullable=False, unique=True)
      email = db.Column(db.String(254), nullable=False, unique=True)
      active = db.Column(db.Boolean(), default=True, nullable=False)
      created_date = db.Column(db.DateTime, default=func.now(), nullable=False)
  
      def __init__(self, username, email):
          self.username = username
          self.email = email
  
      def to_json(self):
          return {
              'id': self.id,
              'username': self.username,
              'email': self.email,
              'active': self.active
          }
  