Changeset - 517da705366c
[Not reviewed]
0 2 0
Christopher Neugebauer - 8 years ago 2016-10-14 18:19:10
chrisjrn@gmail.com
CSV fixes
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
registrasion/reporting/reports.py
Show inline comments
...
 
@@ -286,18 +286,18 @@ class ReportView(object):
 

	
 
    def _render_as_csv(self):
 
        report = self.reports[self.section]
 

	
 
        # Create the HttpResponse object with the appropriate CSV header.
 
        response = HttpResponse(content_type='text/csv')
 
        #response['Content-Disposition'] = 'attachment; filename="somefilename.csv"'
 

	
 
        writer = csv.writer(response)
 
        writer.writerow(list(report.headings()))
 
        encode = lambda i: i.encode("utf8") if isinstance(i, unicode) else i
 
        writer.writerow(list(encode(i) for i in report.headings()))
 
        for row in report.rows():
 
            writer.writerow(list(row))
 
            writer.writerow(list(encode(i) for i in row))
 

	
 
        return response
 

	
 

	
 

	
 
def get_all_reports():
registrasion/reporting/views.py
Show inline comments
...
 
@@ -405,13 +405,13 @@ class AttendeeListReport(ListReport):
 

	
 
@report_view("Attendee", form_type=forms.UserIdForm)
 
def attendee(request, form, user_id=None):
 
    ''' Returns a list of all manifested attendees if no attendee is specified,
 
    else displays the attendee manifest. '''
 

	
 
    if user_id is None and not form.has_changed():
 
    if user_id is None:
 
        return attendee_list(request)
 

	
 
    if form.cleaned_data["user"] is not None:
 
        user_id = form.cleaned_data["user"]
 

	
 
    attendee = people.Attendee.objects.get(user__id=user_id)
0 comments (0 inline, 0 general)