Re: [ZPT] PageTemplate.pt_context signature

2008-01-16 Thread Charlie Clark
be added to the context returned by this method, just like the specified args and options parameters. This is actually described as a possible reason for subclassing in readme.txt. Not sure what you mean. Can you provide an example? Charlie -- Charlie Clark eGenix.com Professional Python

[ZPT] ZPT encoding for non-web pages

2007-09-27 Thread Charlie Clark
the pages manually. Is there any way to change this? 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

Re: [ZPT] Working with encoded values in more recent versions of ZPT

2007-08-21 Thread Charlie Clark
Am 21.08.2007, 05:27 Uhr, schrieb Andreas Jung [EMAIL PROTECTED]: See http://www.zope.org/Collectors/Zope/2339 Thanks. So this means I don't need to write any additional tests? Glad to know you've resolved it. Charlie -- Charlie Clark eGenix.com Professional Python Services directly

[ZPT] Working with encoded values in more recent versions of ZPT

2007-08-20 Thread Charlie Clark
UnicodeDecodeError for result = {'firstname':'charlie', 'surname':'Düsseldorf'} but not if Python string formatting is used tal:content tal:content=python: '%s %s' % (result['firstname'], result['surname']) / Is this the only workaround apart from decoding all return values? Charlie -- Charlie Clark

Re: [ZPT] Working with encoded values in more recent versions of ZPT

2007-08-20 Thread Charlie Clark
since then but the changelog makes no reference to ZPT. Andreas tried hard to control the inevitable string/unicode integration problems. Maybe, you read the available documentation to find out about your choices. Have the ZPT docs been updated? Charlie -- Charlie Clark eGenix.com

Re: [ZPT] Working with encoded values in more recent versions of ZPT

2007-08-20 Thread Charlie Clark
, in interpret Module zope.tal.talinterpreter, line 754, in do_insertStructure_tal UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4: ordinal not in range(128) Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source Python/Zope

Re: [ZPT] How to write input to a file and run a perl script

2007-04-30 Thread Charlie Clark
it lets you do. 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

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

2006-11-15 Thread Charlie Clark
Am 06.11.2006, 23:12 Uhr, schrieb Dieter Maurer [EMAIL PROTECTED]: Charlie Clark wrote at 2006-10-24 22:43 +0200: Am 24.10.2006, 22:26 Uhr, schrieb Dieter Maurer [EMAIL PROTECTED]: It does, but you need to use allowType... Thanks for that. import datetime allow_type(datetime.datetime) do

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

2006-11-15 Thread Charlie Clark
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 -- Charlie Clark eGenix.com Professional Python Services

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

2006-10-24 Thread Charlie Clark
Am 24.10.2006, 22:26 Uhr, schrieb Dieter Maurer [EMAIL PROTECTED]: Charlie Clark wrote at 2006-10-23 16:03 +0200: ... ah, the problem seems that Python datetime returns extension types and not classes and Zope's security does not work with extension types! It does, but you need to use

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

2006-10-23 Thread Charlie Clark
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

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

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

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

Re: [ZPT] creating lists of objects in tal

2006-09-07 Thread Charlie Clark
them in. ZPT's run security checks on all objects which might be one reason for slowing stuff down. I suspect if you rewrite your code to use a single PythonScript then it will run a lot faster and be a lot easier to work with. Charlie -- Charlie Clark Helmholtzstr. 20 Düsseldorf D- 40215