[ZPT] Using alternatives to Zope's DateTime module in PageTemplates

2006-10-23 Thread Charlie Clark

Hi,

this is probably a no brainer but I haven't found a solution to it yet. Is  
there a simple way to enable Python modules for use in PageTemplates as is  
the case with PythonScripts? ie. I would like to be able to replace  
DateTime instances with mxDateTime instances applying formatting  
strftime('%d.%m.%Y') currently throws a security error as neither  
mxDateTime nor even Python's own datetime methods are allowed by default  
in PageTemplates.


Thanks

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!
___
ZPT mailing list
ZPT@zope.org
http://mail.zope.org/mailman/listinfo/zpt


Re: [ZPT] Using alternatives to Zope's DateTime module in PageTemplates

2006-10-23 Thread Charlie Clark

Am 23.10.2006, 14:36 Uhr, schrieb Andreas Jung [EMAIL PROTECTED]:



- lib/python/Products/PythonScripts/README.txt


Exactly the same mechanism? I'll give it a try.

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!
___
ZPT mailing list
ZPT@zope.org
http://mail.zope.org/mailman/listinfo/zpt


Re: [ZPT] Using alternatives to Zope's DateTime module in PageTemplates

2006-10-23 Thread Charlie Clark

Am 23.10.2006, 14:38 Uhr, schrieb Charlie Clark [EMAIL PROTECTED]:


Am 23.10.2006, 14:36 Uhr, schrieb Andreas Jung [EMAIL PROTECTED]:
  - lib/python/Products/PythonScripts/README.txt
 Exactly the same mechanism? I'll give it a try.


I  still have the same problem:

import mx.DateTime, datetime

d1 = mx.DateTime.DateTime(2006, 10, 22)
print d1
print d1.strftime(%Y.%m.%d)

d2 = datetime.datetime(2006, 10, 22)
print d2
print d2.strftime(%Y.%m.%d)

return printed

strftime() works find with the mx.DateTime object but not with the Python  
datetime object. Is an additional security declaration required?


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!
___
ZPT mailing list
ZPT@zope.org
http://mail.zope.org/mailman/listinfo/zpt


Re: [ZPT] Using alternatives to Zope's DateTime module in PageTemplates

2006-10-23 Thread Charlie Clark

Am 23.10.2006, 15:13 Uhr, schrieb Charlie Clark [EMAIL PROTECTED]:


I  still have the same problem:
 import mx.DateTime, datetime
 d1 = mx.DateTime.DateTime(2006, 10, 22)
print d1
print d1.strftime(%Y.%m.%d)
 d2 = datetime.datetime(2006, 10, 22)
print d2
print d2.strftime(%Y.%m.%d)
 return printed
 strftime() works find with the mx.DateTime object but not with the  
Python datetime object. Is an additional security declaration required?


ah, the problem seems that Python datetime returns extension types and not  
classes and Zope's security does not work with extension types!


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!
___
ZPT mailing list
ZPT@zope.org
http://mail.zope.org/mailman/listinfo/zpt