[Checkins] SVN: grok/trunk/doc/ Add the next tutorial sample app.

Martijn Faassen faassen at infrae.com
Fri Mar 16 16:51:35 EDT 2007


Log message for revision 73246:
  Add the next tutorial sample app.
  

Changed:
  A   grok/trunk/doc/groktut/publishing_a_simple_web_page/
  U   grok/trunk/doc/groktut/publishing_a_simple_web_page/src/sample/app.py
  A   grok/trunk/doc/groktut/publishing_a_simple_web_page/src/sample/app_templates/
  A   grok/trunk/doc/groktut/publishing_a_simple_web_page/src/sample/app_templates/index.pt
  U   grok/trunk/doc/tutorial.txt

-=-
Copied: grok/trunk/doc/groktut/publishing_a_simple_web_page (from rev 73241, grok/trunk/doc/groktut/an_empty_grok_project)

Modified: grok/trunk/doc/groktut/publishing_a_simple_web_page/src/sample/app.py
===================================================================
--- grok/trunk/doc/groktut/an_empty_grok_project/src/sample/app.py	2007-03-16 20:32:54 UTC (rev 73241)
+++ grok/trunk/doc/groktut/publishing_a_simple_web_page/src/sample/app.py	2007-03-16 20:51:35 UTC (rev 73246)
@@ -2,3 +2,6 @@
   
 class Sample(grok.Application, grok.Container):
     pass
+
+class Index(grok.View):
+    pass

Added: grok/trunk/doc/groktut/publishing_a_simple_web_page/src/sample/app_templates/index.pt
===================================================================
--- grok/trunk/doc/groktut/an_empty_grok_project/src/sample/app_templates/index.pt	2007-03-16 20:32:54 UTC (rev 73241)
+++ grok/trunk/doc/groktut/publishing_a_simple_web_page/src/sample/app_templates/index.pt	2007-03-16 20:51:35 UTC (rev 73246)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Hello world!</p>
+</body>
+</html>
\ No newline at end of file

Modified: grok/trunk/doc/tutorial.txt
===================================================================
--- grok/trunk/doc/tutorial.txt	2007-03-16 20:45:39 UTC (rev 73245)
+++ grok/trunk/doc/tutorial.txt	2007-03-16 20:51:35 UTC (rev 73246)
@@ -248,26 +248,18 @@
 The ``.pt`` extension indicates that this file is a Zope Page Template
 (ZPT). This allows us to make the page dynamic later on.
 
-Put the following (very simplistic) HTML in the file ``index.pt``::
+Put the following (very simplistic) HTML in the file ``index.pt``:
 
-  <html>
-  <body>
-  <p>Hello world!</p>
-  </body>
-  </html>
+.. include:: groktut/publishing_a_simple_web_page/src/sample/app_templates/index.pt
+  :literal:
 
 We're done with the template for now. Now we need to tell Grok to
 actually use this template. To do this, modify ``src/sample/app.py`` so
-that it reads like this::
+that it reads like this:
 
-  import grok
+.. include:: groktut/publishing_a_simple_web_page/src/sample/app.py
+  :literal:
 
-  class Sample(grok.Application, grok.Container):
-      pass
-
-  class Index(grok.View):
-      pass
-
 As you can see, all we did was add a class called ``Index`` that
 subclasses from ``grok.View``. This indicates to Grok that we want a
 view named ``index`` for the application. A *view* is a way to view



More information about the Checkins mailing list