def to_csv(): filename = request.form.get('filename', 'records.csv') return Response(csv_export.export(), mimetype='text/csv', headers = { 'Content-Disposition': 'attachment; filename="%s"' % (filename,) })
def to_csv(): filename = request.form.get('filename', 'records.csv') return Response(csv_export.export(), mimetype='text/csv', headers={ 'Content-Disposition': 'attachment; filename="%s"' % (filename, ) })
def to_csv(): if get_user_id(): return Response(csv_export.export(), mimetype='text/csv') else: return render_template('error.html', message = "You must be logged in to do this.")
def to_csv(): return Response(csv_export.export(), mimetype='text/csv')