[Zope-dev] Zope 296->210 page template calling prob.
JZopeDev Kioza
jzopedev at kioza.net
Mon Mar 5 22:20:50 EST 2007
Hello,
I have a problem since upgrading to Zope210x that I hope, concerns "Development folks".
I use a call to "custom-internal" pagetemplates in one of my products (actually they are plugins).
With Zope 2.9.6, in my product I use:
return _config.myPT(context={'here':self, 'request':REQUEST})
_config. is a module which initialize myPT as a PageTemplate and read-it in like so:
f = open(aPlugin + '/' + myPT)
myPT = PageTemplate()
myPT.write(f.read())
f.close()
This always worked!
Now, with Zope 2.10.2svn, and the new PageTemplate machinery, this call doesn't work anymore. My custom pagetemplates are full of "here" statements in their TAL expressions and they are not recognized anymore:
Here's the log:
Exception Type KeyError
Exception Value 'here'
Traceback (innermost last):
* Module ZPublisher.Publish, line 119, in publish
* Module ZPublisher.mapply, line 88, in mapply
* Module ZPublisher.Publish, line 42, in call_object
* Module Products.SlashAdmin.SlashAdmin, line 1204, in edit_form
* Module zope.pagetemplate.pagetemplate, line 96, in __call__
* Module zope.pagetemplate.pagetemplate, line 117, in pt_render
* Module zope.tal.talinterpreter, line 271, in __call__
* Module zope.tal.talinterpreter, line 346, in interpret
* Module zope.tal.talinterpreter, line 534, in do_optTag_tal
* Module zope.tal.talinterpreter, line 516, in no_tag
* Module zope.tal.talinterpreter, line 346, in interpret
* Module zope.tal.talinterpreter, line 745, in do_insertStructure_tal
* Module zope.tales.tales, line 696, in evaluate
Line 1, Column 0
Expression: <PathExpr standard:'here/slash_header'>
Names:
{'args': (),
'default': <object object at 0x2b149c76a200>,
'loop': {},
'nothing': None,
'options': {'context': {'here': <SlashAdmin at /testpt/browse used for /testpt/www/DOMAINES>,
'request': <HTTPRequest, URL=http://intranet/DOMAINES/browse/edit_form>}},
'repeat': {},
'template': <zope.pagetemplate.pagetemplate.PageTemplate object at 0x2b14a55ff6d0>,
'usage': <zope.pagetemplate.pagetemplate.TemplateUsage object at 0x2b14a963fd10>}
* Module zope.tales.expressions, line 217, in __call__
* Module zope.tales.expressions, line 194, in _eval
* Module zope.tales.expressions, line 118, in _eval
*********************************************
I have tried many combinations like using extra_context, combining self.. etc.. But I don't follow what changed between Zope version that could affect that.
Surely the "context" key of "options" key (!) does not work as before.
Can someone help?
Tx
jf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-dev/attachments/20070305/94982b80/attachment.htm
More information about the Zope-Dev
mailing list