def get_posts_limit(offset: int = 0, limit: int = 100): """ Returns the posts by limit :param offset: :param limit: :return: """ db = blizzard_db() return DatabaseUtils.limited_results_query( db.query(PostModel).order_by(PostModel.id.desc()), offset=offset, limit=limit)
def get_posts_by_blizzard_id(blizzard_id: int, offset: int = 0, limit: int = 100): """ Returns the posts by blizzard id :param blizzard_id: :param offset: :param limit: :return: """ db = blizzard_db() return DatabaseUtils.limited_results_query(db.query(PostModel).filter( PostModel.user_id == blizzard_id).order_by(desc(PostModel.id)), offset=offset, limit=limit)
def list(db: Session, user_id: int, offset: int = 0, limit: int = 100): query = db.query(UserMetaModel).filter( UserMetaModel.user_id == user_id) return DatabaseUtils.limited_results_query(query, offset=offset, limit=limit)
def missed(db: Session, limit: int = 100, offset: int = 0): return DatabaseUtils.limited_results_query( db.query(CharacterModel).filter(CharacterModel.state == 0), limit=limit, offset=offset, show_removed=True)
def list(db: Session, limit: int = 100, offset: int = 0): return DatabaseUtils.limited_results_query( db.query(MythicRaceModel).order_by(MythicRaceModel.id.desc()), limit=limit, offset=offset)