def csv_export(self, request):
response = HttpResponse(content_type='<STR_LIT>')<EOL>response['<STR_LIT>'] = '<STR_LIT>'<EOL>writer = UnicodeWriter(response)<EOL>writer.writerow([<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>'<EOL>])<EOL>try:<EOL><INDENT>dc, qs = request.META.get('<STR_LIT>', '<STR_LIT>').split('<STR_LIT:?>')<EOL><DEDENT>except ValueError:<EOL><INDENT>qs = '<STR_LIT>'<EOL><DEDENT>request.META['<STR_LIT>'] = qs<EOL>queryset = self.get_changelist(request)(<EOL>request, self.model, self.list_display, self.list_display_links,<EOL>self.list_filter, self.date_hierarchy, self.search_fields,<EOL>self.list_select_related, self.list_per_page,<EOL>self.list_max_show_all, self.list_editable, self<EOL>).get_query_set(request)<EOL>competition_map = {}<EOL>ids = queryset.distinct('<STR_LIT>').values_list(<EOL>'<STR_LIT>', flat=True<EOL>)<EOL>for obj in Competition.objects.filter(id__in=ids):<EOL><INDENT>competition_map[obj.id] = obj<EOL><DEDENT>member_mobile_number_map = {}<EOL>ids = queryset.distinct('<STR_LIT:user>').values_list(<EOL>'<STR_LIT>', flat=True<EOL>)<EOL>for di in Member.objects.filter(id__in=ids).values(<EOL>'<STR_LIT:id>', '<STR_LIT>'<EOL>):<EOL><INDENT>member_mobile_number_map[di['<STR_LIT:id>']] = di['<STR_LIT>']<EOL><DEDENT>for entry in queryset:<EOL><INDENT>competition = competition_map[entry.competition_id]<EOL>entry.competition = competition<EOL>row = [<EOL>entry.competition.id,<EOL>entry.competition.title,<EOL>entry.user.first_name, entry.user.last_name,<EOL>entry.user.email,<EOL>member_mobile_number_map.get(entry.user_id, '<STR_LIT>'),<EOL>entry.competition.question,<EOL>entry.answer_file.name if entry.answer_file else '<STR_LIT>',<EOL>entry.answer_option.text if entry.answer_option else '<STR_LIT>',<EOL>entry.answer_text,<EOL>entry.has_correct_answer(),<EOL>entry.winner,<EOL>entry.timestamp<EOL>]<EOL>writer.writerow(['<STR_LIT>' if f is None else unicode(f) for f in row])  <EOL><DEDENT>return response<EOL>
Return a CSV document of the competition entry and its user
            details