Am 15.11.2006, 21:01 Uhr, schrieb Dieter Maurer <[EMAIL PROTECTED]>:

  Module None, line 31, in generate
   - <PythonScript at /psytec/scripts/generate>
   - Line 31
  Module AccessControl.ZopeGuards, line 284, in guarded_import
ImportError: import of "__doc__" from "time" is unauthorized. You are not
allowed to access '__doc__' in this context
What code do you see in line 31 of "psytec/scripts/generate".
I expect an "import time" there and would be really surprised
when it would contain "someDateTimeObject.strftime(...)".
If I am wrong, then the "RestrictedPython" compiler would
probably generate wrong code.

Why are you surprised that I am formatting a database result?

result.create_date.strftime('%d.%m.%Y') # line 31

This has been cast by psycopg to a Python datetime object which I have added as an allowed type.


Charlie Clark

Professional Python Services directly from the Source
Python/Zope Consulting and Support ...
mxODBC.Zope.Database.Adapter ...   
mxODBC, mxDateTime, mxTextTools ...
Try mxODBC.Zope.DA for Windows, Mac OS, Linux, Solaris, FreeBSD for free!
ZPT mailing list

Reply via email to