Esempio n. 1
0
    def handle(self, *args, **options):

        writer = csv.writer(self.stdout)
        writer.writerow(DataExport.report_churn_header_row())
        for row in DataExport.report_churn():
            writer.writerow(row)
        self.stderr.write(self.style.SUCCESS('Successfully generated report'))
Esempio n. 2
0
def churn_report(request):
    response = HttpResponse(content_type='text/csv')
    response['Content-Disposition'] = 'attachment; filename="churn.csv"'

    writer = csv.writer(response)
    for row in DataExport.report_churn():
        writer.writerow(row)

    return response
Esempio n. 3
0
def churn_report(request):
    response = HttpResponse(content_type='text/csv')
    response['Content-Disposition'] = 'attachment; filename="churn.csv"'

    writer = csv.writer(response)
    for row in DataExport.report_churn():
        writer.writerow(row)

    return response