[Zope-CVS] CVS: Products/CompositePage - composite.py:1.16
slotexpr.py:1.4
Shane Hathaway
shane at zope.com
Fri Mar 12 11:11:31 EST 2004
Update of /cvs-repository/Products/CompositePage
In directory cvs.zope.org:/tmp/cvs-serv2288
Modified Files:
composite.py slotexpr.py
Log Message:
Pass the composite to the template using a keyword argument.
This is a more reliable method of finding the composite.
=== Products/CompositePage/composite.py 1.15 => 1.16 ===
--- Products/CompositePage/composite.py:1.15 Fri Mar 5 16:41:04 2004
+++ Products/CompositePage/composite.py Fri Mar 12 11:11:30 2004
@@ -150,7 +150,7 @@
return renderMacro(template, macro, self)
else:
# Otherwise use TAL-based slotting.
- return template()
+ return template(composite=self)
finally:
self._v_rendering = 0
=== Products/CompositePage/slotexpr.py 1.3 => 1.4 ===
--- Products/CompositePage/slotexpr.py:1.3 Mon Mar 8 15:03:45 2004
+++ Products/CompositePage/slotexpr.py Fri Mar 12 11:11:30 2004
@@ -62,13 +62,13 @@
'Slot expression syntax error near %s' % repr(s))
def __call__(self, econtext):
- context = econtext.contexts.get('here')
+ context = econtext.contexts.get('options')
if context is None:
- context = econtext.context.get('context')
- if context is None:
- raise RuntimeError("Could not find context")
- if IComposite.isImplementedBy(context):
- slot = context.slots.get(self._name, self._class_name, self._title)
+ raise RuntimeError("Could not find options")
+ composite = context.get('composite')
+ if IComposite.isImplementedBy(composite):
+ slot = composite.slots.get(
+ self._name, self._class_name, self._title)
# Render the slot
return "".join(slot.multiple())
else:
More information about the Zope-CVS
mailing list