'Return the query after adding the order_by clauses.
Use the manager\'s default_order_by if order_by is None.'

def _apply_order_by(self, query, order_by):

    if (order_by is None):
        return query.order_by(*self._default_order_by())
    if isinstance(order_by, (list, tuple)):
        return query.order_by(*order_by)
    return query.order_by(order_by)
