def list_query_history(request):
 DEFAULT_PAGE_SIZE = 100
 prefix = 'q-'
 share_queries = request.user.is_superuser
 querydict_query = request.GET.copy()
 if (not share_queries):
  querydict_query[(prefix + 'user')] = request.user.username
 app_name = get_app_name(request)
 querydict_query[(prefix + 'type')] = app_name
 (page, filter_params) = _list_query_history(request.user, querydict_query, DEFAULT_PAGE_SIZE, prefix)
 filter = ((request.GET.get((prefix + 'search')) and request.GET.get((prefix + 'search'))) or '')
 if (request.GET.get('format') == 'json'):
  resp = {'queries': [massage_query_history_for_json(app_name, query_history) for query_history in page.object_list]}
  return JsonResponse(resp)
 return render('list_history.mako', request, {'request': request, 'page': page, 'filter_params': filter_params, 'share_queries': share_queries, 'prefix': prefix, 'filter': filter})

def list_query_history ( request ) : DEFAULT_PAGE_SIZE = 100 prefix = 'q-' share_queries = request . user . is_superuser querydict_query = request . GET . copy ( ) if ( not share_queries ) : querydict_query [ ( prefix + 'user' ) ] = request . user . username app_name = get_app_name ( request ) querydict_query [ ( prefix + 'type' ) ] = app_name ( page , filter_params ) = _list_query_history ( request . user , querydict_query , DEFAULT_PAGE_SIZE , prefix ) filter = ( ( request . GET . get ( ( prefix + 'search' ) ) and request . GET . get ( ( prefix + 'search' ) ) ) or '' ) if ( request . GET . get ( 'format' ) == 'json' ) : resp = { 'queries' : [ massage_query_history_for_json ( app_name , query_history ) for query_history in page . object_list ] } return JsonResponse ( resp ) return render ( 'list_history.mako' , request , { 'request' : request , 'page' : page , 'filter_params' : filter_params , 'share_queries' : share_queries , 'prefix' : prefix , 'filter' : filter } )
view the history of query .