Here is the generated stub that raises the exception: def setLastPkt(self, value): assert value is not None # have DateTime if value is not None: if type(value) is type(''): value = DateTime.DateTimeFrom(value) if type(value) is not DateTime.DateTimeType: raise TypeError, 'expecting datetime type, but got value %r of type %r instead' % (value, type(value))
On Thu, 27 Jan 2005 10:39:12 -0600, jacob martinson <[EMAIL PROTECTED]> wrote: > Hi, > > I am having a problem with MiddleKit. I think the generated code is > not handling datetime data correctly. Can save datatime data ok (it > populates the table correctly) but when I try to retrieve objects, I > get an exception like this: > > Traceback (most recent call last): > File "./NSC.py", line 116, in ? > main() > File "./NSC.py", line 113, in main > test3() > File "./NSC.py", line 110, in test3 > nsc.recycleSessions() > File "./NSC.py", line 23, in recycleSessions > sessions = self.store.fetchObjectsOfClass('NetSession',clauses=srch) > File "MiddleKit/Run/SQLObjectStore.py", line 298, in fetchObjectsOfClass > File "MiddleKit/Run/MiddleObject.py", line 90, in readStoreData > File "/root/airlock/Middle/GeneratedPy/GenNetSession.py", line 231, > in setLastPkt > raise TypeError, 'expecting datetime type, but got value %r of > type %r instead' % (value, type(value)) > TypeError: expecting datetime type, but got value > datetime.datetime(2005, 1, 27, 9, 58, 38) of type <type > 'datetime.datetime'> instead > > I found another user with a similar problem from back in December: > http://www.mail-archive.com/webware-devel@lists.sourceforge.net/msg02075.html > > I am using: > > webware 0.8.1 > python 2.3.4 > mx 2.0 > mysql 4.0.23 > > I'm guessing the temporary solution to this is to use Python 2.2? > > Thanks! > > -Jacob > ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Webware-discuss mailing list Webware-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/webware-discuss