def render_to_response(self, context):
     response = HttpResponse(mimetype='text/csv')
     response['Content-Disposition'] = 'attachment; filename=%s.csv' % str(unicode(context['project']['title']).encode('utf-8'))
     
     writer = UnicodeWriter(response)
     writer.writerow([context['project']['title']])
     writer.writerow([context['project']['description']])
     writer.writerow([])
     writer.writerows(context['table'])
     return response
예제 #2
0
    def render_to_response(self, context):
        response = HttpResponse(mimetype='text/csv')
        response['Content-Disposition'] = 'attachment; filename=%s.csv' % str(
            unicode(context['project']['title']).encode('utf-8'))

        writer = UnicodeWriter(response)
        writer.writerow([context['project']['title']])
        writer.writerow([context['project']['description']])
        writer.writerow([])
        writer.writerows(context['table'])
        return response
예제 #3
0
    def render_to_response(self, context):
        response = HttpResponse(mimetype="text/csv")
        response["Content-Disposition"] = "attachment; filename=%s.csv" % str(
            unicode(context["project"]["title"]).encode("utf-8")
        )

        writer = UnicodeWriter(response)
        writer.writerow([context["project"]["title"]])
        writer.writerow([context["project"]["description"]])
        writer.writerow([])
        writer.writerows(context["table"])
        return response