'Apply presentation parameters -- sorting and paging -- to the given
query.
:return: new query with presentation applied'

@classmethod
def apply_presentation(cls, query, filter_data):

    (special_params, _) = cls._extract_special_params(filter_data)
    sort_by = special_params.get('sort_by', None)
    if sort_by:
        assert (isinstance(sort_by, list) or isinstance(sort_by, tuple))
        query = query.extra(order_by=sort_by)
    query_start = special_params.get('query_start', None)
    query_limit = special_params.get('query_limit', None)
    if (query_start is not None):
        if (query_limit is None):
            raise ValueError('Cannot    pass    query_start    without    query_limit')
        query_limit += query_start
    return query[query_start:query_limit]
