mimetype is now content_type (Django 1.7)

This commit is contained in:
Basile Clement 2016-05-23 23:57:03 +02:00
parent 8adb59ad06
commit 28bd07a433
2 changed files with 4 additions and 4 deletions

View file

@ -6,7 +6,7 @@ from django.contrib.auth.models import User
def export(qs, fields=None):
model = qs.model
response = HttpResponse(mimetype='text/csv')
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename=%s.csv' % slugify(model.__name__)
writer = csv.writer(response)
# Write headers to CSV file

View file

@ -694,7 +694,7 @@ def registration(request):
@buro_required
def export_members(request):
response = HttpResponse(mimetype = 'text/csv')
response = HttpResponse(content_type = 'text/csv')
response['Content-Disposition'] = 'attachment; filename=membres_cof.csv'
writer = unicodecsv.UnicodeWriter(response)
@ -707,7 +707,7 @@ def export_members(request):
@buro_required
def csv_export_mega(filename, qs):
response = HttpResponse(mimetype = 'text/csv')
response = HttpResponse(content_type = 'text/csv')
response['Content-Disposition'] = 'attachment; filename=' + filename
writer = unicodecsv.UnicodeWriter(response)
@ -723,7 +723,7 @@ def csv_export_mega(filename, qs):
@buro_required
def export_mega_remarksonly(request):
filename = 'remarques_mega_2015.csv'
response = HttpResponse(mimetype = 'text/csv')
response = HttpResponse(content_type = 'text/csv')
response['Content-Disposition'] = 'attachment; filename=' + filename
writer = unicodecsv.UnicodeWriter(response)