title: Django export the csv of Multiple Objects
body: <p>I am wrong on the where？i would like to export the details of the objects</p>
  
  <p>this line is &lt; for r in x[0]['user']:> but i don't know why?</p>
  
  <p>Django Version: 1.6.2
  Exception Type: KeyError
  Exception Value: 0</p>
  
  <pre><code>def export_excel(request):
      response = HttpResponse(mimetype='application/vnd.ms-excel; charset="Shift_JIS"')
      response['Content-Disposition'] = 'attachment; filename=file.csv'
      writer = csv.writer(response)
      titles = ["No","name","date","start_time","off_time"]
      writer.writerow(titles)
      obj_all = attendance.objects.filter(id = 1).values('user', 'contact_date', 'contact_time').order_by("-contact_time")
      lea = leavework.objects.filter(id = 1).values('contact_time').order_by('-contact_time')
      row = []
      for x in obj_all:
          for r in x[0]['user']:
              row.append(r)
          writer.writerow(row)
  
      return response
  </code></pre>