def render_to_response(self, context, **response_kwargs):
        import csv

        # Create the HttpResponse object with the appropriate CSV header.
        response = HttpResponse(content_type='text/csv; charset=utf-8')
        response['Content-Disposition'] = self.derive_filename() % 'attachment; filename=%s'

        writer = csv.writer(response, quoting=csv.QUOTE_ALL)

        fields = self.derive_fields()

        # build up our header row
        header = []
        for field in fields:
            header.append(six.text_type(self.lookup_field_label(dict(), field)))
        writer.writerow([s.encode("utf-8") for s in header])

        # then our actual values
        for obj in self.object_list:
            row = []
            for field in fields:
                row.append(six.text_type(self.lookup_field_value(dict(), obj, field)))
            writer.writerow([s.encode("utf-8") for s in row])

        return response
dataset/ETHPy150Open nyaruka/smartmin/smartmin/views.py/SmartCsvView.render_to_response/swapped operands of `%`