def _filter_documents(request, queryset, flatten=True):
 type_filters = request.GET.getlist('type', None)
 sort = request.GET.get('sort', '-last_modified')
 search_text = request.GET.get('text', None)
 return __filter_documents(type_filters, sort, search_text, queryset, flatten)

def _filter_documents ( request , queryset , flatten = True ) : type_filters = request . GET . getlist ( 'type' , None ) sort = request . GET . get ( 'sort' , '-last_modified' ) search_text = request . GET . get ( 'text' , None ) return __filter_documents ( type_filters , sort , search_text , queryset , flatten )
given optional querystring params extracted from the request .