On Wed, 2008-04-02 at 09:36 +0200, Constantin Christmann wrote: > Hello, > > I am trying to get a sequence of dictionaries instead of a sequence of > tuples from cursor.fetchall() > > When googleing I found some examples doing this by > c = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) > c.fetchall() > > But when looking at the source of the psychopg2 DatabaseWrapper there > is no cursor_factory parameter for cursor creation. > Can someone explane me how it should be done or where I can find the > documentation?
Wouldn't it be better to ask this question on the psycopg2 mailing list? It's not really related to Django. However it certainly looks like cursors take a cursor_factory parameter based on trying it out. Typing "psycopg2 documentation" into Google rapidly leads to http://www.initd.org/tracker/psycopg/wiki/psycopg2_documentation for the documentation. > Can things like that be found in the python docs or is this wrapper > specific? It's very database wrapper specific. See the Frequently Asked Questions section of the DB API PEP (http://www.python.org/dev/peps/pep-0249/ ) Regards, Malcolm -- He who laughs last thinks slowest. http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---