<s> from django . conf . urls import patterns , url <EOL> from django . core . urlresolvers import reverse <EOL> from django . http import HttpResponseRedirect <EOL> from avocado . query . utils import async_get_result_rows <EOL> from serrano . resources . exporter import ExporterResource , ExporterRootResource <EOL> from serrano . resources . processors import ASYNC_EXPORTER_RESULT_PROCESSOR_NAME <EOL> class AsyncExporterResource ( ExporterResource ) : <EOL> """<STR_LIT>""" <EOL> def get ( self , request , export_type , ** kwargs ) : <EOL> view = self . get_view ( request ) <EOL> context = self . get_context ( request ) <EOL> params = self . get_params ( request ) <EOL> query_options = { <EOL> '<STR_LIT>' : export_type , <EOL> '<STR_LIT>' : self . _get_query_name ( request , export_type ) , <EOL> } <EOL> query_options . update ( ** kwargs ) <EOL> query_options . update ( params ) <EOL> job_data = { <EOL> '<STR_LIT>' : self . _get_query_name ( request , export_type ) , <EOL> '<STR_LIT>' : request . user . username , <EOL> '<STR_LIT>' : request . session . session_key , <EOL> '<STR_LIT>' : ASYNC_EXPORTER_RESULT_PROCESSOR_NAME <EOL> } <EOL> job_id = async_get_result_rows ( <EOL> context , view , query_options , job_data ) <EOL> return HttpResponseRedirect ( <EOL> reverse ( '<STR_LIT>' , kwargs = { '<STR_LIT>' : job_id } ) ) <EOL> exporter_resource = AsyncExporterResource ( ) <EOL> exporter_root_resource = ExporterRootResource ( ) <EOL> urlpatterns = patterns ( <EOL> '<STR_LIT>' , <EOL> url ( r'<STR_LIT>' , exporter_root_resource , name = '<STR_LIT>' ) , <EOL> url ( <EOL> r'<STR_LIT>' , <EOL> exporter_resource , <EOL> name = '<STR_LIT>' <EOL> ) , <EOL> url ( <EOL> r'<STR_LIT>' , <EOL> exporter_resource , <EOL> name = '<STR_LIT>' <EOL> ) , <EOL> url ( <EOL> r'<STR_LIT>' , <EOL> exporter_resource , <EOL> name = '<STR_LIT>' <EOL> ) , <EOL> ) </s>
