def all(self, order_by=None, limit=0):
        """
            Fetch all items.

            :param limit: How many rows to fetch.
            :param order_by: column on which to order the results. \
            To change the sort, prepend with < or >.

        """
        with rconnect() as conn:
            try:
                query = self._base()
                if order_by is not None:
                    query = self._order_by(query, order_by)
                if limit > 0:
                    query = self._limit(query, limit)

                log.debug(query)
                rv = query.run(conn)
            except Exception as e:
                log.warn(e)
                raise
            else:
                data = [self._model(_) for _ in rv]
                return data
def all ( self , order_by = None , limit = 0 ) : with rconnect ( ) as conn : try : query = self . _base ( ) if order_by is not None : query = self . _order_by ( query , order_by ) if limit > 0 : query = self . _limit ( query , limit ) log . debug ( query ) rv = query . run ( conn ) except Exception as e : log . warn ( e ) raise else : data = [ self . _model ( _ ) for _ in rv ] return data
Fetch all items.

            :param limit: How many rows to fetch.
            :param order_by: column on which to order the results. \
            To change the sort, prepend with < or >.