def _generate_paginate_query(context, session, marker, limit, sort_keys, sort_dirs, filters, offset=None, paginate_type=models.Volume):
 (get_query, process_filters, get) = PAGINATION_HELPERS[paginate_type]
 (sort_keys, sort_dirs) = process_sort_params(sort_keys, sort_dirs, default_dir='desc')
 query = get_query(context, session=session)
 if filters:
  query = process_filters(query, filters)
  if (query is None):
   return None
 marker_object = None
 if (marker is not None):
  marker_object = get(context, marker, session)
 return sqlalchemyutils.paginate_query(query, paginate_type, limit, sort_keys, marker=marker_object, sort_dirs=sort_dirs, offset=offset)

def _generate_paginate_query ( context , session , marker , limit , sort_keys , sort_dirs , filters , offset = None , paginate_type = models . Volume ) : ( get_query , process_filters , get ) = PAGINATION_HELPERS [ paginate_type ] ( sort_keys , sort_dirs ) = process_sort_params ( sort_keys , sort_dirs , default_dir = 'desc' ) query = get_query ( context , session = session ) if filters : query = process_filters ( query , filters ) if ( query is None ) : return None marker_object = None if ( marker is not None ) : marker_object = get ( context , marker , session ) return sqlalchemyutils . paginate_query ( query , paginate_type , limit , sort_keys , marker = marker_object , sort_dirs = sort_dirs , offset = offset )
generate the query to include the filters and the paginate options .