[Checkins] SVN: grok/trunk/src/grok/tests/view/template.py test
that grok.name and grok.template can be combined
Philipp von Weitershausen
philikon at philikon.de
Mon Oct 16 03:20:59 EDT 2006
Log message for revision 70669:
test that grok.name and grok.template can be combined
Changed:
U grok/trunk/src/grok/tests/view/template.py
-=-
Modified: grok/trunk/src/grok/tests/view/template.py
===================================================================
--- grok/trunk/src/grok/tests/view/template.py 2006-10-16 07:11:13 UTC (rev 70668)
+++ grok/trunk/src/grok/tests/view/template.py 2006-10-16 07:20:58 UTC (rev 70669)
@@ -13,6 +13,12 @@
>>> print view()
<html><body><h1>GROK PAINT MAMMOTH!</h1></body></html>
+``grok.name`` and ``grok.template`` can be combined:
+
+ >>> view = component.getMultiAdapter((manfred, request), name='meal')
+ >>> print view()
+ <html><body><h1>GROK EAT MAMMOTH!</h1></body></html>
+
"""
import grok
@@ -25,3 +31,11 @@
cavepainting = grok.PageTemplate("""\
<html><body><h1>GROK PAINT MAMMOTH!</h1></body></html>
""")
+
+class Food(grok.View):
+ grok.template('food_template')
+ grok.name('meal')
+
+food_template = grok.PageTemplate("""\
+<html><body><h1>GROK EAT MAMMOTH!</h1></body></html>
+""")
More information about the Checkins
mailing list