def import_demo_csv_part2():
 job_id = request.post_vars.job
 if (not job_id):
  return "Error No Job ID's provided"
 request.controller = 'stats'
 output = s3_rest_controller('stats', 'demographic_data', csv_stylesheet='demographic_data.xsl')
 totalRecords = output[0]
 totalErrors = output[1]
 totalIgnored = output[2]
 from gluon.serializers import json as jsons
 response.headers['Content-Type'] = 'application/json'
 return jsons({'totalRecords': totalRecords, 'totalErrors': totalErrors, 'totalIgnored': totalIgnored})

def import_demo_csv_part2 ( ) : job_id = request . post_vars . job if ( not job_id ) : return "Error No Job ID's provided" request . controller = 'stats' output = s3_rest_controller ( 'stats' , 'demographic_data' , csv_stylesheet = 'demographic_data.xsl' ) totalRecords = output [ 0 ] totalErrors = output [ 1 ] totalIgnored = output [ 2 ] from gluon . serializers import json as jsons response . headers [ 'Content-Type' ] = 'application/json' return jsons ( { 'totalRecords' : totalRecords , 'totalErrors' : totalErrors , 'totalIgnored' : totalIgnored } )
controller to manage the second phase of the import of demographic data from csv .