[Checkins] SVN: grok/trunk/doc/ Converting another section to use
actual samples.
Martijn Faassen
faassen at infrae.com
Fri Mar 16 16:57:44 EDT 2007
Log message for revision 73247:
Converting another section to use actual samples.
Changed:
A grok/trunk/doc/groktut/a_second_view/
U grok/trunk/doc/groktut/a_second_view/src/sample/app.py
A grok/trunk/doc/groktut/a_second_view/src/sample/app_templates/bye.pt
U grok/trunk/doc/tutorial.txt
-=-
Copied: grok/trunk/doc/groktut/a_second_view (from rev 73246, grok/trunk/doc/groktut/publishing_a_simple_web_page)
Modified: grok/trunk/doc/groktut/a_second_view/src/sample/app.py
===================================================================
--- grok/trunk/doc/groktut/publishing_a_simple_web_page/src/sample/app.py 2007-03-16 20:51:35 UTC (rev 73246)
+++ grok/trunk/doc/groktut/a_second_view/src/sample/app.py 2007-03-16 20:57:43 UTC (rev 73247)
@@ -5,3 +5,7 @@
class Index(grok.View):
pass
+
+class Bye(grok.View):
+ pass
+
Added: grok/trunk/doc/groktut/a_second_view/src/sample/app_templates/bye.pt
===================================================================
--- grok/trunk/doc/groktut/publishing_a_simple_web_page/src/sample/app_templates/bye.pt 2007-03-16 20:51:35 UTC (rev 73246)
+++ grok/trunk/doc/groktut/a_second_view/src/sample/app_templates/bye.pt 2007-03-16 20:57:43 UTC (rev 73247)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Bye world!</p>
+</body>
+</html>
Modified: grok/trunk/doc/tutorial.txt
===================================================================
--- grok/trunk/doc/tutorial.txt 2007-03-16 20:51:35 UTC (rev 73246)
+++ grok/trunk/doc/tutorial.txt 2007-03-16 20:57:43 UTC (rev 73247)
@@ -303,28 +303,17 @@
``edit`` view to change its contents.
To create a second view, create another template called ``bye.pt`` in
-``app_templates``. Make it have the following content::
+``app_templates``. Make it have the following content:
- <html>
- <body>
- <p>Bye world!</p>
- </body>
- </html>
+.. include:: groktut/a_second_view/src/sample/app_templates/bye.pt
+ :literal:
We need to tell Grok that this template is available as a view. Modify
-``app.py`` to read like this::
+``app.py`` to read like this:
- import grok
+.. include:: groktut/a_second_view/src/sample/app.py
+ :literal:
- class Sample(grok.Application, grok.Container):
- pass
-
- class Index(grok.View):
- pass
-
- class Bye(grok.View):
- pass
-
Restart Zope. You can now go to a new web page called ``bye``:
http://localhost:8080/test/bye
More information about the Checkins
mailing list