from django.db import connection
conn = connection.cursor()
conn.execute("some select query..")
print( conn.fetchall() )
This shows that result from cursor.fetchall() is list of tuples, though in docs there is example:
>>> cursor.execute("SELECT id, parent_id FROM test LIMIT 2");
>>> cursor.fetchall()
((54360982, None), (54360880, None))
That shows that result is not list, but tuple of tuples.
Little bit confused, What I'm missing here?
Thanks
(54360982, None)is a tuple. And((54360982, None), (54360880, None))is a tuple of tuples, which is like in the docs. That is why the return type is also the builtintuple, checked with mySQL and sqlalchemy which again uses MySQLdb for the cursor:Out:
Your remark
seems to say that
from django.db import connectionleads to an output:At least if I understand you right. If that is true, I do not understand it either, I can only say from the test with sqlalchemy that this looks like a mere
djangoproblem, as already said in the comments.