mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +03:00
Extra DictRow methods.
This commit is contained in:
parent
63698c6c28
commit
88f7ce153a
|
@ -1,13 +1,15 @@
|
|||
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
|
||||
to avoid using None as bound variables (very importand for cursor
|
||||
subclasses calling cursor.execute(self, query, None).
|
||||
|
||||
2005-05-18 Federico Di Gregorio <fog@debian.org>
|
||||
|
||||
* 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.)
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user