Extra DictRow methods.

This commit is contained in:
Federico Di Gregorio 2005-05-19 04:48:26 +00:00
parent 63698c6c28
commit 88f7ce153a
2 changed files with 16 additions and 2 deletions

View File

@ -1,13 +1,15 @@
2005-05-19 Federico Di Gregorio <fog@debian.org> 2005-05-19 Federico Di Gregorio <fog@debian.org>
* Release 2.0b2.
* lib/extras.py (DictRow): Some extra methods for DictRow.
* psycopg/cursor_type.c (_psyco_curs_execute): added explict check * psycopg/cursor_type.c (_psyco_curs_execute): added explict check
to avoid using None as bound variables (very importand for cursor to avoid using None as bound variables (very importand for cursor
subclasses calling cursor.execute(self, query, None). subclasses calling cursor.execute(self, query, None).
2005-05-18 Federico Di Gregorio <fog@debian.org> 2005-05-18 Federico Di Gregorio <fog@debian.org>
* Release 2.0b2.
* ZPsycopgDA/DA.py (ALLOWED_PSYCOPG_VERSIONS): updated to work * ZPsycopgDA/DA.py (ALLOWED_PSYCOPG_VERSIONS): updated to work
with 2.0b2 only (will support only the exact version untill final with 2.0b2 only (will support only the exact version untill final
2.0 release.) 2.0 release.)

View File

@ -79,6 +79,18 @@ class DictRow(list):
def keys(self): def keys(self):
return self._index.keys() return self._index.keys()
def values(self):
return tuple(self[:])
def has_key(self, x):
return self._index.has_key(x)
def get(self, x, default=None):
try:
return self[x]
except:
return default
class SQL_IN(object): class SQL_IN(object):