diff options
author | Federico Di Gregorio <fog@initd.org> | 2005-07-17 04:08:08 +0000 |
---|---|---|
committer | Federico Di Gregorio <fog@initd.org> | 2005-07-17 04:08:08 +0000 |
commit | 5f00dc11009101e10f03fdcd5be3e33e34256e70 (patch) | |
tree | 61942704ed9d2a03ae8bd2aca4ee306df439ce97 /lib/extras.py | |
parent | 5edfdc2a547e2d57752841294d270c3e03894e3b (diff) | |
download | psycopg2-5f00dc11009101e10f03fdcd5be3e33e34256e70.tar.gz |
Preparing release 2.0b4.
Diffstat (limited to 'lib/extras.py')
-rw-r--r-- | lib/extras.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/extras.py b/lib/extras.py index aae5e4f..16fc555 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -18,9 +18,14 @@ and classes untill a better place in the distribution is found. # for more details. from psycopg2.extensions import cursor as _cursor +from psycopg2.extensions import connection as _connection from psycopg2.extensions import register_adapter as _RA from psycopg2.extensions import adapt as _A +class DictConnection(_connection): + """A connection that uses DictCursor automatically.""" + def cursor(self): + return _connection.cursor(self, cursor_factory=DictCursor) class DictCursor(_cursor): """A cursor that keeps a list of column name -> index mappings.""" |