Exemplo n.º 1
0
 def handle(self, *args, **kwargs):
     if kwargs.get('file'):
         print("Exporting file {}.".format(kwargs['file']))
         csv_import.export_guests(kwargs['file'])
     else:
         print("Please provde a file.")
         exit(1)
Exemplo n.º 2
0
def export_guests(request):
    export = csv_import.export_guests()
    response = HttpResponse(export.getvalue(), content_type='text/csv')
    response['Content-Disposition'] = 'attachment; filename=all-guests.csv'
    return response
Exemplo n.º 3
0
def export_guests(request):
    export = csv_import.export_guests()
    response = HttpResponse(export.getvalue(), content_type='text/csv')
    response.content = export.getvalue()
    return response