@staticmethod
    def importAnswers(complete_id, question_list):

        import csv
        import os

        strio = StringIO()
        strio.write(question_list)
        strio.seek(0)
        answer = []
        append = answer.append
        reader = csv.reader(strio)
        for row in reader:
            if row != None:
                row.insert(0, complete_id)
                append(row)

        from tempfile import TemporaryFile
        csvfile = TemporaryFile()
        writer = csv.writer(csvfile)
        writerow = writer.writerow
        writerow(["complete_id", "question_code", "value"])
        for row in answer:
            writerow(row)
        csvfile.seek(0)
        xsl = os.path.join("applications",
                           current.request.application,
                           "static",
                           "formats",
                           "s3csv",
                           "survey",
                           "answer.xsl")
        resource = current.s3db.resource("survey_answer")
        resource.import_xml(csvfile, stylesheet = xsl, format="csv",)

    # -------------------------------------------------------------------------
Download media link
dataset/ETHPy150Open sahana/eden/modules/s3db/survey.py/S3SurveyCompleteModel.importAnswers--crossover with--dataset/ETHPy150Open kobotoolbox/kobocat/onadata/apps/main/models/meta_data.py/create_media