mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
Applied DictRow "diet" patch
This commit is contained in:
parent
aecdf33b17
commit
06eb574cec
|
@ -1,3 +1,7 @@
|
||||||
|
2009-05-10 Federico Di Gregorio <fog@initd.org>
|
||||||
|
|
||||||
|
* lib/extras.py: applied DictRow "diet" patch from Marko Kreen.
|
||||||
|
|
||||||
2009-04-21 Federico Di Gregorio <fog@initd.org>
|
2009-04-21 Federico Di Gregorio <fog@initd.org>
|
||||||
|
|
||||||
* setup.py: applied patch from Elvis Pranskevichus to make
|
* setup.py: applied patch from Elvis Pranskevichus to make
|
||||||
|
|
|
@ -107,6 +107,8 @@ class DictCursor(DictCursorBase):
|
||||||
class DictRow(list):
|
class DictRow(list):
|
||||||
"""A row object that allow by-colun-name access to data."""
|
"""A row object that allow by-colun-name access to data."""
|
||||||
|
|
||||||
|
__slots__ = ('_index',)
|
||||||
|
|
||||||
def __init__(self, cursor):
|
def __init__(self, cursor):
|
||||||
self._index = cursor.index
|
self._index = cursor.index
|
||||||
self[:] = [None] * len(cursor.description)
|
self[:] = [None] * len(cursor.description)
|
||||||
|
@ -191,6 +193,9 @@ class RealDictCursor(DictCursorBase):
|
||||||
self._query_executed = 0
|
self._query_executed = 0
|
||||||
|
|
||||||
class RealDictRow(dict):
|
class RealDictRow(dict):
|
||||||
|
|
||||||
|
__slots__ = ('_column_mapping',)
|
||||||
|
|
||||||
def __init__(self, cursor):
|
def __init__(self, cursor):
|
||||||
dict.__init__(self)
|
dict.__init__(self)
|
||||||
self._column_mapping = cursor.column_mapping
|
self._column_mapping = cursor.column_mapping
|
||||||
|
|
Loading…
Reference in New Issue
Block a user