[Twisted-Python] psycopg2 and dictcursor
Jonathan Vanasco
twisted-python at 2xlp.com
Mon Apr 24 13:13:03 MDT 2006
Hi all
I'm picking up twisted again ( haven't touched it for a while )
Luckily twisted plays great with psycopg2
I really prefer using the dictcursor in psycopg2 though:
does anyone know how to get twisted to utilize it? i haven't been
able to figure it out based on docs or google
a non twisted example of what i'm talking about follows
===
import psycopg2
from psycopg2 import extras
class DataBase:
def __init__(self):
self.profile = []
self.db = psycopg2.connect
( host="localhost",database="db",user="user",password="")
def get_cursor(self):
return self.db.cursor( cursor_factory = psycopg2.extras.DictCursor )
More information about the Twisted-Python
mailing list