def export_form_to_xform(request, id): survey = utils.create_survey_from_csv_text(SurveyDraft.objects.get(pk=id).body) response = HttpResponse(survey.to_xml(), mimetype='application/force-download') response['Content-Disposition'] = 'attachment; filename=survey.xml' return response
def csv_to_xform(request): csv_data = request.POST.get('txtImport') survey = utils.create_survey_from_csv_text(csv_data) response = HttpResponse(survey.to_xml(), mimetype='application/force-download') response['Content-Disposition'] = 'attachment; filename=survey.xml' return response
def export_form_to_xform(request, id): survey = utils.create_survey_from_csv_text( SurveyDraft.objects.get(pk=id).body) response = HttpResponse(survey.to_xml(), mimetype='application/force-download') response['Content-Disposition'] = 'attachment; filename=survey.xml' return response
def test_parses_survey_passed_in_as_csv_and_returns_xml_representation( self): xml = utils.create_survey_from_csv_text(text).to_xml() etree.fromstring(xml)
def test_parses_survey_passed_in_as_csv_and_returns_xml_representation(self): xml = utils.create_survey_from_csv_text(text).to_xml() etree.fromstring(xml)