[ZPT] Using alternatives to Zope's DateTime module in
PageTemplates
Charlie Clark
charlie at egenix.com
Wed Nov 15 14:15:45 EST 2006
Am 06.11.2006, 23:12 Uhr, schrieb Dieter Maurer <dieter at handshake.de>:
> Charlie Clark wrote at 2006-10-24 22:43 +0200:
>> Am 24.10.2006, 22:26 Uhr, schrieb Dieter Maurer <dieter at handshake.de>:
>>> It does, but you need to use "allowType"...
>>
>> Thanks for that.
>>
>> import datetime
>>
>> allow_type(datetime.datetime)
>>
>> do work but
>>
>> calling strftime() on a datetime object throws an import error
>>
>> Error Type: ImportError
>> Error Value: import of "__doc__" from "time" is unauthorized. You are
>> not
>> allowed to access '__doc__' in this context
>>
>> Is this correct?
> You know that you must always (!) provide full error information.
> This includes a traceback (beside "Error Type" and "Error Value".
Apologies. Just had this come up again. Now with the full traceback:
Traceback (innermost last):
Module ZPublisher.Publish, line 115, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 41, in call_object
Module Shared.DC.Scripts.Bindings, line 311, in __call__
Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 325, in _exec
Module None, line 6, in process_bank
- <PythonScript at /psytec/fachbereich/shrinks/anmelden/process_bank>
- Line 6
Module Shared.DC.Scripts.Bindings, line 311, in __call__
Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 325, in _exec
Module None, line 26, in set_bank
- <PythonScript at /psytec/fachbereich/shrinks/anmelden/set_bank>
- Line 26
Module Shared.DC.Scripts.Bindings, line 311, in __call__
Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 325, in _exec
Module None, line 7, in premium
- <PythonScript at /psytec/scripts/premium>
- Line 7
Module Shared.DC.Scripts.Bindings, line 311, in __call__
Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 325, in _exec
Module None, line 15, in printBill
- <PythonScript at /psytec/scripts/printBill>
- Line 15
Module Shared.DC.Scripts.Bindings, line 311, in __call__
Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 325, in _exec
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
All I am doing is calling strftime() on a datetime object.
Charlie
--
Charlie Clark
eGenix.com
Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
Try mxODBC.Zope.DA for Windows, Mac OS, Linux, Solaris, FreeBSD for free!
More information about the ZPT
mailing list