def get_packages(channel: db_models.Channel = Depends(get_channel_or_fail), dao: Dao = Depends(get_dao), q: str = None): """ Retrieve all packages in a channel, optionally matching a query `q`. """ return dao.get_packages(channel.name, 0, -1, q)
def get_packages(channel: db_models.Channel = Depends(get_channel_or_fail), dao: Dao = Depends(get_dao), skip: int = 0, limit: int = -1, q: str = None): """ Retrieve all packages in a channel. A limit of -1 returns an unpaginated result with all packages. Otherwise, pagination is applied. """ return dao.get_packages(channel.name, skip, limit, q)
def get_paginated_packages( channel: db_models.Channel = Depends(get_channel_or_fail), dao: Dao = Depends(get_dao), skip: int = 0, limit: int = PAGINATION_LIMIT, q: Optional[str] = None, order_by: Optional[str] = None, ): """ Retrieve all packages in a channel. A limit of -1 returns an unpaginated result with all packages. Otherwise, pagination is applied. """ return dao.get_packages(channel.name, skip, limit, q, order_by)
def get_packages( channel: db_models.Channel = Depends(get_channel_or_fail), dao: Dao = Depends(get_dao), skip: int = 0, limit: int = 10, q: str = None): return dao.get_packages(channel.name, skip, limit, q)