[Zope-DB] Problem with TALES DateTime conversion

Charlie Clark charlie@begeistert.org
Sat, 15 Mar 2003 16:39:37 +0100


On 2003-03-15 at 15:00:02 [+0100], charlie@begeistert.org wrote:
> >  > 
> >  > It just gives me 'instance' both for DateTime objects which I can 
> >  > convert using strftime and Date objects which I can't :-/
> > 
> > Sorry, I should have known that.
> > 
> > Try "str(aDateObject.__class__)", again inside your External Method.
> > 
> Strange I just get DateTime.DateTime.DateTime for both types. I switched 
> to using mxDateTime which is an option in Psycopg and while this produces 
> an error for the above call (__class__ isn't allowed), it does allow me 
> to do the formatting I want. Still, I'm curious to know what/where the 
> error is.

Weird, using mxDateTime on the server (linux) seems to cause a security 
look-up. I get a login box and the error "strftime not allowed to be used 
in this context". I have to use mxDateTime on Windows but it seems the DA 
forgets this regularly as I get the IOError from DateTime.py and then have 
to close and reopen the DA :-( at which point the error goes away.

Charlie