Check out the ``django.db.backend.dictfetch*`` functions. For example:
from django.db import connection, backend
c = connection.cursor()
c.execute(SQL)
rows = backend.dictfetchall(c)
Jacob
--~--~-~--~~~---~--~~
You received this message because y
I looked at a lot of different ways of doing this, and it looks like
the django.db cursor needs to be hacked to support MySQLdb's
DicCursor. That seems overkill since its easy to just import MySQLdb
yourself, and the prebuild django.db libraries are mostly just for the
Models. Your other option i
On Freitag, 9. Februar 2007, Dirk Eschler wrote:
> Hello,
>
> is there a way to get a dictcursor from Django when using custom MySQL?
>
> >from django.db import connection
>
> cursor = connection.cursor()
> cursor.execute("SELECT [...]")
> cursor.fetchall()
>
> The above fetchall returns a tuple,
Hello,
is there a way to get a dictcursor from Django when using custom MySQL?
from django.db import connection
cursor = connection.cursor()
cursor.execute("SELECT [...]")
cursor.fetchall()
The above fetchall returns a tuple, while i need a dict, like it is built with
MySQLdb.cursors.DictCurso
4 matches
Mail list logo