Re: Custom SQL - MySQL Dictcursor

2007-04-11 Thread Jacob Kaplan-Moss
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

Re: Custom SQL - MySQL Dictcursor

2007-04-11 Thread shwag
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

Re: Custom SQL - MySQL Dictcursor

2007-02-11 Thread Dirk Eschler
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,

Custom SQL - MySQL Dictcursor

2007-02-09 Thread Dirk Eschler
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