def list(cls, page=0, limit=10) -> List[User]: offset = page * limit accounts = User.objects().filter().limit(limit).skip(offset) return list(accounts)
def get_by_email(cls, email: str): user = User.objects().filter(email=email).first() return user
def get_by_username(cls, username: str): user = User.objects().filter(username=username).first() return user
def get_by_id(cls, uid: str): user = User.objects().filter(id=uid).first() return user