[SQL-CVS] r1785 - SQLObject/trunk/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2006-05-19 15:39:24
|
Author: phd Date: 2006-05-19 09:39:13 -0600 (Fri, 19 May 2006) New Revision: 1785 Modified: SQLObject/trunk/sqlobject/col.py Log: Applied the SF patch [ 1483018 ] Play nicely with DateTime from Zope. Modified: SQLObject/trunk/sqlobject/col.py =================================================================== --- SQLObject/trunk/sqlobject/col.py 2006-05-19 14:42:44 UTC (rev 1784) +++ SQLObject/trunk/sqlobject/col.py 2006-05-19 15:39:13 UTC (rev 1785) @@ -47,7 +47,7 @@ from mx import DateTime except ImportError: try: - import DateTime # old version of mxDateTime + import DateTime # old version of mxDateTime, or Zope's Version if we're running with Zope except ImportError: mxdatetime_available = False else: @@ -60,7 +60,10 @@ if mxdatetime_available: DateTimeType = type(DateTime.now()) - TimeType = type(DateTime.Time()) + if hasattr(DateTime, "Time"): + TimeType = type(DateTime.Time()) + else: # Zope + TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) if datetime_available: default_datetime_implementation = DATETIME_IMPLEMENTATION |