# Path: project/user/models/user.py
# class User(RBACUserMixin, UserMixin, Base):
#     __tablename__ = 'users'
# 
#     id = Column(Integer, primary_key=True)
#     username = Column(String(64), unique=True)
#     email = Column(String(128), unique=True)
#     password = Column(String(128))
#     api_key = Column(String(128))
# 
#     roles = relationship('Role', secondary='user_roles')
# 
#     def __repr__(self):
#         return '<User %r>' % self.username


from project.user.models.user import User


class UserFinder:

    @classmethod
    def all(cls):
        return User.query.filter().all()

    @classmethod
    def by_id(cls, user_id):
        return User.query.filter(User.id == user_id).first()

    @classmethod
    def by_username(cls, username):

# Path: project/user/models/user.py
# class User(RBACUserMixin, UserMixin, Base):
#     __tablename__ = 'users'
# 
#     id = Column(Integer, primary_key=True)
#     username = Column(String(64), unique=True)
#     email = Column(String(128), unique=True)
#     password = Column(String(128))
#     api_key = Column(String(128))
# 
#     roles = relationship('Role', secondary='user_roles')
# 
#     def __repr__(self):
#         return '<User %r>' % self.username


# Path: project/user/finders/user_finder.py
from project.user.models.user import User



class UserFinder:

    @classmethod
    def all(cls):
        return User.query.filter().all()

    @classmethod
    def by_id(cls, user_id):
        return User.query.filter(User.id == user_id).first()

    @classmethod
    def by_username(cls, username):

        return User.query.filter(User.username == username).first()