diff --git a/ChangeLog b/ChangeLog index 35127a8a..73147536 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,15 @@ 2005-05-19 Federico Di Gregorio + * Release 2.0b2. + + * lib/extras.py (DictRow): Some extra methods for DictRow. + * psycopg/cursor_type.c (_psyco_curs_execute): added explict check to avoid using None as bound variables (very importand for cursor subclasses calling cursor.execute(self, query, None). 2005-05-18 Federico Di Gregorio - * Release 2.0b2. - * ZPsycopgDA/DA.py (ALLOWED_PSYCOPG_VERSIONS): updated to work with 2.0b2 only (will support only the exact version untill final 2.0 release.) diff --git a/lib/extras.py b/lib/extras.py index a494d8a7..55168b51 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -79,6 +79,18 @@ class DictRow(list): def keys(self): 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):