title: Serializing Django queryset to JSON: getting AttributeError 'tuple' object has no attribute '_meta'
body: <p>I'm using Django 1.8. This is my view:</p>
  
  <pre><code>from django.http import JsonResponse
  
  ...
  query = "SELECT * FROM frontend_chemical WHERE id LIKE %s"
  cursor.execute(query, (code + "%",))
  data = cursor.fetchall()
  print data
  return JsonResponse(serializers.serialize('json', data), safe=False)
  </code></pre>
  
  <p>But this gives me: </p>
  
  <pre><code>AttributeError at /api/1.0/bnf_code: 'tuple' object has no attribute '_meta'
  </code></pre>
  
  <p>At the line: </p>
  
  <pre><code>return JsonResponse(serializers.serialize('json', data), safe=True) 
  </code></pre>
  
  <p>In the console, I can see that my data has returned OK:</p>
  
  <pre><code>[(u'0210', u'Stable angina, acute coronary syndromes, and fibrinolysis'), (u'0211', u'Antifibrinolytic drugs and haemostatics'), (u'0212', u'Lipid-regulating drugs'), (u'0213', u'Local sclerosants')]
  </code></pre>
  
  <p>Any idea what might be going wrong? </p>
  
  <p>UPDATE: I've also been trying to get the data as a dictionary, using <code>data = dictfetchall(cursor)</code> <a href="https://docs.djangoproject.com/en/1.8/topics/db/sql/" rel="nofollow">as described here</a>. </p>
  
  <p>However, this just fails in the same place with a slightly different error: </p>
  
  <pre><code>AttributeError: 'dict' object has no attribute '_meta'
  </code></pre>