Small DA fixes.

This commit is contained in:
Federico Di Gregorio 2006-06-08 00:17:32 +00:00
parent 122925a7fa
commit 2e2b4ad01a
3 changed files with 12 additions and 6 deletions

10
NEWS
View File

@ -1,8 +1,14 @@
What's new in psycopg 2.0 beta 8 What's new in psycopg 2.0
-------------------------------- -------------------------
* Fixed handle leak on win32. * Fixed handle leak on win32.
* If available the new "safe" encoding functions of libpq are used.
* django and tinyerp people, please switch to psycopg 2 _without_
using a psycopg 1 compatibility layer (this release was anticipated
so that you all stop grumbling about psycopg 2 is still in beta.. :)
What's new in psycopg 2.0 beta 7 What's new in psycopg 2.0 beta 7
-------------------------------- --------------------------------

View File

@ -134,13 +134,11 @@ class Connection(Shared.DC.ZRDB.Connection.Connection):
register_type(ZDATETIME) register_type(ZDATETIME)
register_type(ZDATE) register_type(ZDATE)
register_type(ZTIME) register_type(ZTIME)
register_type(ZINTERVAL)
else: else:
# use the standard # use the standard
register_type(DATETIME) register_type(DATETIME)
register_type(DATE) register_type(DATE)
register_type(TIME) register_type(TIME)
register_type(INTERVAL)
## browsing and table/column management ## ## browsing and table/column management ##
@ -238,7 +236,8 @@ def _cast_Time(iso, curs):
time.localtime(time.time())[:3]+ time.localtime(time.time())[:3]+
time.strptime(iso[:8], "%H:%M:%S")[3:])) time.strptime(iso[:8], "%H:%M:%S")[3:]))
# TODO: DateTime does not support intervals: what's the best we can do? # NOTE: we don't cast intervals anymore because they are passed
# untouched to Zope.
def _cast_Interval(iso, curs): def _cast_Interval(iso, curs):
return iso return iso

View File

@ -105,7 +105,8 @@ class DB(TM, dbi_db.DB):
elif typ == ROWID: elif typ == ROWID:
typs = 'i' typs = 'i'
typp = ROWID typp = ROWID
elif typ == DATETIME or typ == DATE: # FIXME: shouldn't DATETIME include other types?
elif typ == DATETIME or typ == DATE or typ == TIME:
typs = 'd' typs = 'd'
typp = DATETIME typp = DATETIME
else: else: