[Checkins] SVN: grok/www/ Both index.html and about.html are now also generated from rest source and use

Darryl Cousins darryl at darrylcousins.net.nz
Thu Mar 29 07:39:08 EDT 2007


Log message for revision 73906:
  Both index.html and about.html are now also generated from rest source and use
  the same template as for tutorial.
  
  I've also included meta tags 'keywords' and 'description' - these can be edited
  in grok/doc/template.pt and the html regenerated using grok2html.py.
  
  

Changed:
  U   grok/www/about.html
  U   grok/www/index.html
  U   grok/www/resources/grok.css
  U   grok/www/tutorial.html

-=-
Modified: grok/www/about.html
===================================================================
--- grok/www/about.html	2007-03-29 11:34:34 UTC (rev 73905)
+++ grok/www/about.html	2007-03-29 11:39:06 UTC (rev 73906)
@@ -1,56 +1,61 @@
-<html>
 
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
-	<title>Grok</title>
+  <title>Grok: now even cavemen can use Zope 3
+</title>
+  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+  <meta name="description" content="Grok - now even cavemen can use Zope3" />
+  <meta name="keywords" content="Grok, internet, zope, zope3, software, web apps, web applications, python" />
 	<style type="text/css"><!-- @import url(./resources/grok.css); --></style>
 </head>
 
 <body>
-
 <div class="header">
 	
 	<a href="http://grok.zope.org">
-	<img src="./resources/grok-header.jpg" alt="GROK"/></a>
-
+	<img src="./resources/grok-header.jpg" alt="GROK" /></a>
 	<ul id="navigation">
-		<li><a href="./index.html">Home</a></li>
-		<li><a class="selected" href="./about.html">About</a></li>
-		<li><a href="./tutorial.html">Tutorial</a></li>
-	</ul>
-	
+        <li>
+            <a href="index.html" class="" title="Home">Home</a></li>
+        <li>
+            <a href="about.html" class="selected"
+               title="About">About</a></li>
+        <li>
+            <a href="tutorial.html" class=""
+               title="Tutorial">Tutorial</a></li>
+  </ul>
 </div>
 
 
 <div class="roundcont">
 	
-   <div class="roundtop">
-	 <img src="./resources/corner-topleft.jpg" alt="" 
-	 width="45" height="45" class="corner" 
-	 style="display: none" />
-   </div>
+  <div class="roundtop">
+    <img src="./resources/corner-topleft.jpg" alt="" width="45" height="45" class="corner" style="display: none" />
+  </div>
 
-	<div class="content">
+  <div class="content">
 
-<h1 class="title">Grok: now even cavemen can use Zope 3</h1>
-
-<div class="section" id="grok-experience-expertise-extensibility">
-<h1>Grok: Experience, Expertise, Extensibility</h1>
+          <h1 class="title">Grok: now even cavemen can use Zope 3</h1>
 <p>Grok is a web application framework for Python developers. It is aimed
 at both beginners and very experienced web developers. Grok has an
 emphasis on agile development. Grok is easy <em>and</em> powerful.</p>
+<div class="section">
+<h2><a id="grok-experience-expertise-extensibility" name="grok-experience-expertise-extensibility">Grok: Experience, Expertise, Extensibility</a></h2>
 <p>You will likely have heard about many different web frameworks for
 Python as well as other languages. Why you should you consider Grok?</p>
 <ul class="simple">
 <li>Grok offers a <em>lot</em> of building blocks for your web application.</li>
 <li>Grok is informed by a <em>lot</em> of hard-earned wisdom.</li>
 </ul>
-<p>Grok accomplishes this by being based on <a href="http://wiki.zope.org/zope3/">Zope 3</a>, an advanced
+<p>Grok accomplishes this by being based on Zope 3, an advanced
 object-oriented web framework. While Grok is based on Zope 3, and
 benefits a lot from it, you do not need to know Zope at all in order
 to get productive with Grok.</p>
-
-<div class="section" id="grok-is-agile">
-<h2>Grok is agile</h2>
+<div class="section">
+<h3><a id="grok-is-agile" name="grok-is-agile">Grok is agile</a></h3>
 <p>Grok doesn't require you to edit cryptic configuration files. Instead
 you just program in Python and create HTML templates. Beyond this,
 Grok also offers a wide range of built-in features at your fingertips,
@@ -61,15 +66,15 @@
 thanks to <a class="reference" href="http://cheeseshop.python.org/pypi/grokproject">grokproject</a>, you'll be able to create your first web app
 with Grok in no time.</p>
 </div>
-<div class="section" id="grok-offers-a-very-wide-range-of-features">
-<h2>Grok offers a very wide range of features</h2>
+<div class="section">
+<h3><a id="grok-offers-a-very-wide-range-of-features" name="grok-offers-a-very-wide-range-of-features">Grok offers a very wide range of features</a></h3>
 <p>Through Zope 3, Grok offers a very wide range of building blocks for
 your web application. What's more, Zope 3 components are typically
 rock-solid due to extensive unit-testing and well-specified API
 documentation.</p>
 </div>
-<div class="section" id="grok-is-grounded-in-a-deep-experience-with-web-development">
-<h2>Grok is grounded in a deep experience with web development</h2>
+<div class="section">
+<h3><a id="grok-is-grounded-in-a-deep-experience-with-web-development" name="grok-is-grounded-in-a-deep-experience-with-web-development">Grok is grounded in a deep experience with web development</a></h3>
 <p>Grok, through Zope 3, is informed by hard-earned wisdom. Zope 3 is a
 powerful and flexible web application framework for Python that has
 been under continuous development since 2001.  Zope 3's design in turn
@@ -80,8 +85,8 @@
 <p>The Zope community has been around for a while. We've built a lot and
 learned a lot. We are in this for the long run.</p>
 </div>
-<div class="section" id="grok-for-the-future">
-<h2>Grok for the future</h2>
+<div class="section">
+<h3><a id="grok-for-the-future" name="grok-for-the-future">Grok for the future</a></h3>
 <p>Successful web applications aren't built for a day - such an
 application will need to be maintained, extended, evolved, over a
 period of many years. Zope developers really know this. Grok, through
@@ -89,15 +94,8 @@
 over time.</p>
 </div>
 </div>
-<div class="section" id="grok-zope-3-for-cavemen">
-	
-<h1>Grok: Zope 3 for cavemen</h1>
-
-<div class="sidebar">
-<p class="first sidebar-title">"The Grok developers think Zope 3 is great"</p>
-<a href="http://wiki.zope.org/zope3/FrontPage"><img src="./resources/zopelogo.gif" alt="Zope" style="padding: 0.5em;" /></a>
-</div>
-
+<div class="section">
+<h2><a id="grok-zope-3-for-cavemen" name="grok-zope-3-for-cavemen">Grok: Zope 3 for cavemen</a></h2>
 <p>Grok stands on a giant's shoulder. That giant is Zope 3.</p>
 <p>Zope 3 is an advanced object oriented web framework. Zope 3 features a
 large amount of API documentation and aims for reliability. It has a
@@ -122,11 +120,8 @@
 it simpler and more effective, for beginners and experienced
 developers alike. Grok: now even cavemen can use Zope 3.</p>
 </div>
-
-<img src="./resources/grok-campfire.jpg" alt="Grok and the campfire" />
-
-<div class="section" id="grok-from-the-zope-3-perspective">
-<h1>Grok from the Zope 3 perspective</h1>
+<div class="section">
+<h2><a id="grok-from-the-zope-3-perspective" name="grok-from-the-zope-3-perspective">Grok from the Zope 3 perspective</a></h2>
 <p>Zope 3 allows you to combine different components in an explicit,
 flexible way. You can hook up a view to a model, an event handler to
 an event, and a new API to an existing object. The process of doing
@@ -154,17 +149,14 @@
 patterns more easy to use and succinct.</p>
 </div>
 
+  </div>
 
-</div>
+  <div class="roundbottom">
+     <img src="./resources/corner-bottomleft.jpg" alt="" width="45" height="45" class="corner" style="display: none" />
+  </div>
 
-<div class="roundbottom">
-	 <img src="./resources/corner-bottomleft.jpg" alt="" 
-	 width="45" height="45" class="corner" 
-	 style="display: none" />
 </div>
 
-</div>
-
 <div class="footer">
 	
 	<table><tr><td>
@@ -180,4 +172,5 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>
+

Modified: grok/www/index.html
===================================================================
--- grok/www/index.html	2007-03-29 11:34:34 UTC (rev 73905)
+++ grok/www/index.html	2007-03-29 11:39:06 UTC (rev 73906)
@@ -1,153 +1,130 @@
-<html>
 
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
-	<title>Grok</title>
+  <title>What is Grok?
+</title>
+  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+  <meta name="description" content="Grok - now even cavemen can use Zope3" />
+  <meta name="keywords" content="Grok, internet, zope, zope3, software, web apps, web applications, python" />
 	<style type="text/css"><!-- @import url(./resources/grok.css); --></style>
 </head>
 
 <body>
-
 <div class="header">
 	
 	<a href="http://grok.zope.org">
-	<img src="./resources/grok-header.jpg" alt="GROK"/></a>
-
+	<img src="./resources/grok-header.jpg" alt="GROK" /></a>
 	<ul id="navigation">
-		<li><a class="selected" href="./index.html">Home</a></li>
-		<li><a href="./about.html">About</a></li>
-		<li><a href="./tutorial.html">Tutorial</a></li>
-	</ul>
-	
+        <li>
+            <a href="index.html" class="selected"
+               title="Home">Home</a></li>
+        <li>
+            <a href="about.html" class="" title="About">About</a></li>
+        <li>
+            <a href="tutorial.html" class=""
+               title="Tutorial">Tutorial</a></li>
+  </ul>
 </div>
 
 
 <div class="roundcont">
 	
-   <div class="roundtop">
-	 <img src="./resources/corner-topleft.jpg" alt="" 
-	 width="45" height="45" class="corner" 
-	 style="display: none" />
-   </div>
+  <div class="roundtop">
+    <img src="./resources/corner-topleft.jpg" alt="" width="45" height="45" class="corner" style="display: none" />
+  </div>
 
-	<div class="content">
+  <div class="content">
 
-<h1>What is Grok?</h1>
-
-<img src="./resources/evencaveman.jpg" alt="Now even cavemen can use Zope 3" 
-     style="margin: 0 0 1em 1em; float: right;" />
-
-
-<p>Grok is a web application framework for Python developers. It is aimed
-at both beginners and very experienced web developers. Grok has an
-emphasis on agile development. Grok is easy <em>and</em> powerful.</p>
-<p>You will likely have heard about many different web frameworks for
-Python as well as other languages. Why should you consider Grok?</p>
+          <h1 class="title">What is Grok?</h1>
+<img alt="Now even cavemen can use Zope3" class="right" src="./resources/evencaveman.jpg" />
+<p>Grok is a web application framework for Python developers. It is aimed at both
+beginners and very experienced web developers. Grok has an emphasis on agile
+development. Grok is easy and powerful.</p>
+<p>You will likely have heard about many different web frameworks for Python as
+well as other languages. Why should you consider Grok?</p>
 <ul class="simple">
 <li>Grok offers a <em>lot</em> of building blocks for your web application.</li>
 <li>Grok is informed by a <em>lot</em> of hard-earned wisdom.</li>
 </ul>
-<p>Grok accomplishes this by being based on <a href="http://wiki.zope.org/zope3/">Zope 3</a>, an advanced
+<p>Grok accomplishes this by being based on <a class="reference" href="http://wiki.zope.org/zope3">Zope 3</a>, an advanced
 object-oriented web framework. While Grok is based on Zope 3, and
 benefits a lot from it, you do not need to know Zope at all in order
 to get productive with Grok.</p>
-
-<p><a href="./about.html">Read More &raquo;</a></p>
-
-<h1 style="clear: both;">Who is Grok?</h1>
-
-<img src="./resources/grok-standing.jpg" alt="Grok!" 
-     style="float: right; margin: 0 0 1em 1em; border: 1px solid #a0a0a0; background: white;" />
-
-<p>
-Grok is a friendly caveman from the Stone Age.  He has a big club that
-he hunts mammoths with.  He will also use this club to smash anything
-he doesn't like.
-</p>
-
-<p>
-"ME GROK SMASH ZCML!"
-</p>
-
-<p>The word grok comes from the novel
-<a href="http://en.wikipedia.org/wiki/Stranger_in_a_Strange_Land">Stranger in a Strange Land</a>
-by Robert A. Heinlein, and is defined in his book as:</p>
-
+<p><a class="reference" href="./about.html">Read More</a></p>
+<div class="section">
+<h2><a id="who-is-grok" name="who-is-grok">Who is Grok?</a></h2>
+<img alt="Grok!" class="right" src="./resources/grok-standing.jpg" />
+<p>Grok is a friendly caveman from the Stone Age. He has a big club that he hunts
+mammoths with. He will also use this club to smash anything he doesn't like.</p>
+<p>&quot;ME GROK SMASH ZCML!&quot;</p>
+<p>The word grok comes from the novel <a class="reference" href="http://en.wikipedia.org/wiki/Stranger_in_a_Strange_Land">Stranger in a Strange Land</a> by Robert A.
+Heinlein, and is defined in his book as:</p>
 <blockquote>
-Grok means to understand so thoroughly that the
-observer becomes part of the observed - to merge,
-blend, intermarry, lose identity in group experience.
-</blockquote>
-
-<h1 style="clear: both;">Watch Grok in action</h1>
-
-<ul>
-	<li><a href="http://www.archive.org/details/grok_todo_part1">Simple ToDo application</a> is a tutorial-style introduction to Grok by Philipp von Weitershausen.</li>
-	<li><a href="http://comlounge.tv/blog/archive/2007/02/11/cltv23-snow-sprint-2007-grok-presentation">Introduction to Grok</a> is a talk given by Philipp von Weitershausen to a group of Zope developers.</li>
+Grok means to understand so thoroughly that the observer becomes part of the
+observed - to merge, blend, intermarry, lose identity in group experience.</blockquote>
+</div>
+<div class="section">
+<h2><a id="watch-grok-in-action" name="watch-grok-in-action">Watch Grok in Action</a></h2>
+<ul class="simple">
+<li><a class="reference" href="http://www.archive.org/details/grok_todo_part1">Simple ToDo</a> application is a tutorial-style introduction to Grok by Philipp von Weitershausen.</li>
+<li><a class="reference" href="http://comlounge.tv/blog/archive/2007/02/11/cltv23-snow-sprint-2007-grok-presentation">Introduction to Grok</a> is a talk given by Philipp von Weitershausen to a group of Zope developers.</li>
 </ul>
-
-<h1>What does Grok code look like?</h1>
-
-<pre>
+</div>
+<div class="section">
+<h2><a id="what-does-grok-code-look-like" name="what-does-grok-code-look-like">What does Grok code look like?</a></h2>
+<pre class="literal-block">
 import grok
 
 class HelloWorld(grok.Application, grok.Model):
     pass
 
-index = grok.PageTemplate("""
-&lt;html&gt;&lt;body&gt;
-	&lt;p&gt;ME GROK HELLO WORLD!&lt;/p&gt;
-&lt;/body&gt;&lt;/html&gt;
-"""")
+    index = grok.PageTemplate(&quot;&quot;&quot;
+    &lt;html&gt;&lt;body&gt;
+        &lt;p&gt;ME GROK HELLO WORLD!&lt;/p&gt;
+    &lt;/body&gt;&lt;/html&gt;
+    &quot;&quot;&quot;&quot;)
 </pre>
-
-<ul>
-  <li><a href="http://www.z3lab.org/sections/blogs/philipp-weitershausen/2007_01_09_you-thought-zope-3-wasn">Herd of Mammoths</a> is a very simple application that only goes a bit beyond "hello world".</li>
-  <li><a href="http://svn.zope.org/Grokstar/">Grokstar</a> is a simple wiki application written with Grok.</li>
-  <li><a href="http://svn.zope.org/grok/trunk/grokwiki/">Grok Wiki</a> is a simple wiki application written with Grok.</li>
-  <li><a href="http://grok.tfws.org.nz/">Tree Fern Web Services</a> contains
-	two Grok Applications, a simple internationalized Content Management System, and a StoryBoard application capable of managing and resizing
-images.
-  </li>
+<ul class="simple">
+<li><a class="reference" href="http://www.z3lab.org/sections/blogs/philipp-weitershausen/2007_01_09_you-thought-zope-3-wasn">Herd of Mammoths</a> is a very simple application that only goes a bit beyond &quot;hello world&quot;.</li>
+<li><a class="reference" href="http://svn.zope.org/Grokstar/">Grokstar</a> is a simple wiki application written with Grok.</li>
+<li><a class="reference" href="http://svn.zope.org/grok/trunk/grokwiki/">Grok Wiki</a> is a simple wiki application written with Grok.</li>
 </ul>
-
-<h1>ME GROK HYPERLINKS!</h1>
-
-<ul>
-	<li>Get the latest version in the form of a <a href="http://cheeseshop.python.org/pypi/grok">Grok Python Package</a> from the Python Cheese Shop.</li>
-	<li>Feature requests and bugs are tracked in the <a href="https://launchpad.net/grok">Grok Issue Tracker</a> at LaunchPad.</li>
-	<li><a href="http://mail.zope.org/mailman/listinfo/grok-dev">Grok-dev mailing list</a> for discussing the development of Grok.</li>
-	<li>There is a <a href="irc://irc.freenode.net/grok">grok IRC</a> channel on <a href="http://freenode.net/">freenode.net</a>.</li>
+</div>
+<div class="section">
+<h2><a id="me-grok-hyperlinks" name="me-grok-hyperlinks">ME GROK HYPERLINKS!</a></h2>
+<ul class="simple">
+<li>Get the latest version in the form of a <a class="reference" href="http://cheeseshop.python.org/pypi/grok">Grok Python Package</a> from the Python Cheese Shop.</li>
+<li>Feature requests and bugs are tracked in the <a class="reference" href="https://launchpad.net/grok">Grok Issue Tracker</a> at LaunchPad.</li>
+<li><a class="reference" href="http://mail.zope.org/mailman/listinfo/grok-dev">Grok-dev mailing list</a> for discussing the development of Grok.</li>
+<li>There is a <a class="reference" href="irc://irc.freenode.net/grok">Grok IRC</a> channel on <a class="reference" href="http://freenode.net/">freenode.net</a></li>
 </ul>
-
-<p>The source code to Grok is kept in the Zope SVN repository. You can
-do an anonymous check out of the latest version of Grok with the following command:
-</p>
-
-<pre>
+<p>The source code to Grok is kept in the Zope SVN repository. You can do an
+anonymous check out of the latest version of Grok with the following command::</p>
+<pre class="literal-block">
 svn co svn://svn.zope.org/repos/main/grok/trunk grok
 </pre>
-
-<h1>ME GROK SPRINTS AND BLOGS!</h1>
-
-<p>
-Grok development is often done in the form of <i>sprints</i>.
-A sprint is a when a group of developers get together in the same place
-and all work on a focused set of tasks.
-</p>
-
-<ul>
-	<li><a href="http://faassen.n--tree.net/blog/view/weblog/2006/11/09/0">Martijn Faassen's blog entry</a> details the first Grok sprint.</li>
-	<li><a href="http://jw.n--tree.net/blog/dev/python/second-grok-sprint">Jan-Wijbrand Kolman blogged</a> about the second Grok sprint, and <a href="http://faassen.n--tree.net/blog/view/weblog/2007/01/09/0">Martijn Faassen blogged about it</a> as well.</li>
+</div>
+<div class="section">
+<h2><a id="me-grok-sprints-and-blogs" name="me-grok-sprints-and-blogs">ME GROK SPRINTS AND BLOGS!</a></h2>
+<p>Grok development is often done in the form of sprints. A sprint is a when a
+group of developers get together in the same place and all work on a focused
+set of tasks.</p>
+<ul class="simple">
+<li><a class="reference" href="http://faassen.n--tree.net/blog/view/weblog/2006/11/09/0">Martijn Faassen's blog entry</a> details the first Grok sprint.</li>
+<li><a class="reference" href="http://jw.n--tree.net/blog/dev/python/second-grok-sprint">Jan-Wijbrand Kolman blogged</a> about the second Grok sprint, and <a class="reference" href="http://faassen.n--tree.net/blog/view/weblog/2007/01/09/0">Martijn Faassen
+blogged</a> about it as well.</li>
 </ul>
-
 </div>
 
-<div class="roundbottom">
-	 <img src="./resources/corner-bottomleft.jpg" alt="" 
-	 width="45" height="45" class="corner" 
-	 style="display: none" />
-</div>
+  </div>
 
+  <div class="roundbottom">
+     <img src="./resources/corner-bottomleft.jpg" alt="" width="45" height="45" class="corner" style="display: none" />
+  </div>
+
 </div>
 
 <div class="footer">
@@ -166,3 +143,4 @@
 
 </body>
 </html>
+

Modified: grok/www/resources/grok.css
===================================================================
--- grok/www/resources/grok.css	2007-03-29 11:34:34 UTC (rev 73905)
+++ grok/www/resources/grok.css	2007-03-29 11:39:06 UTC (rev 73906)
@@ -12,11 +12,11 @@
     border: 0px;
 }
 
-h1 {
+h1.title {
     font-family:"Lucida Grande", "Bitstream Vera Sans", Verdana, sans-serif;
     margin-top: 1.5em;
     color: #7C490C;
-    border-bottom: 1px dotted #FAC079;
+    border-bottom: 1px solid #FAC079;
     padding-bottom: 0.2em;
     font-size: 150%;
     clear: both;
@@ -24,9 +24,19 @@
 
 h2 {
     font-family:"Lucida Grande", "Bitstream Vera Sans", Verdana, sans-serif;
+    margin-top: 1.5em;
+    color: #7C490C;
+    border-bottom: 1px dotted #FAC079;
+    padding-bottom: 0.2em;
+    font-size: 130%;
+    clear: both;
+}
+
+h3 {
+    font-family:"Lucida Grande", "Bitstream Vera Sans", Verdana, sans-serif;
     margin-top: 1em;
     color: #7C490C;
-    font-size: 125%;
+    font-size: 120%;
     clear: both;
 }
 
@@ -129,7 +139,6 @@
 }
 
 /* ME GROK ROUND 2.0 */
-
 .content {
   margin: 0 2em;
   text-align: left;
@@ -161,6 +170,9 @@
 }
 
 /* Grok ReST Styles */
+img.right {
+    float:right;
+}
 
 div.sidebar {
   margin-left: 2em;
@@ -213,7 +225,7 @@
 }
 
 a.reference {
-    color: #707070;
+    color: #303030;
     text-decoration: none;
 }
 

Modified: grok/www/tutorial.html
===================================================================
--- grok/www/tutorial.html	2007-03-29 11:34:34 UTC (rev 73905)
+++ grok/www/tutorial.html	2007-03-29 11:39:06 UTC (rev 73906)
@@ -1,65 +1,82 @@
-<html>
 
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
-        <title>Grok</title>
-        <style type="text/css"><!-- @import url(./resources/grok.css); --></style>
+  <title>Grok tutorial
+</title>
+  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+  <meta name="description" content="Grok - now even cavemen can use Zope3" />
+  <meta name="keywords" content="Grok, internet, zope, zope3, software, web apps, web applications, python" />
+	<style type="text/css"><!-- @import url(./resources/grok.css); --></style>
 </head>
 
 <body>
-
 <div class="header">
-        
-        <a href="http://grok.zope.org">
-        <img src="./resources/grok-header.jpg" alt="GROK"/></a>
-
-        <ul id="navigation">
-                <li><a href="./index.html">Home</a></li>
-				<li><a href="./about.html">About</a></li>
-                <li><a class="selected" href="./tutorial.html">Tutorial</a></li>
-        </ul>
-        
+	
+	<a href="http://grok.zope.org">
+	<img src="./resources/grok-header.jpg" alt="GROK" /></a>
+	<ul id="navigation">
+        <li>
+            <a href="index.html" class="" title="Home">Home</a></li>
+        <li>
+            <a href="about.html" class="" title="About">About</a></li>
+        <li>
+            <a href="tutorial.html" class="selected"
+               title="Tutorial">Tutorial</a></li>
+  </ul>
 </div>
 
 
 <div class="roundcont">
-        
-   <div class="roundtop">
-         <img src="./resources/corner-topleft.jpg" alt="" 
-         width="45" height="45" class="corner" 
-         style="display: none" />
-   </div>
+	
+  <div class="roundtop">
+    <img src="./resources/corner-topleft.jpg" alt="" width="45" height="45" class="corner" style="display: none" />
+  </div>
 
-	<div class="content">
+  <div class="content">
 
-	<h1 class="title">Grok tutorial</h1>
-
-<div class="contents topic" id="contents">
-<p class="topic-title first">Contents</p>
+          <h1 class="title">Grok tutorial</h1>
+<div class="contents topic">
+<p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
 <ul class="simple">
-<li><a class="reference" href="#setting-up-grokproject" id="id1">Setting up grokproject</a></li>
-<li><a class="reference" href="#creating-a-grok-project" id="id2">Creating a grok project</a></li>
-<li><a class="reference" href="#starting-up-zope" id="id3">Starting up Zope</a></li>
-<li><a class="reference" href="#an-empty-grok-project" id="id4">An empty Grok project</a></li>
-<li><a class="reference" href="#publishing-a-simple-web-page" id="id5">Publishing a simple web page</a></li>
-<li><a class="reference" href="#a-second-view" id="id6">A second view</a></li>
-<li><a class="reference" href="#making-our-page-dynamic" id="id7">Making our page dynamic</a></li>
-<li><a class="reference" href="#static-resources-for-our-web-page" id="id8">Static resources for our web page</a></li>
-<li><a class="reference" href="#using-view-methods" id="id9">Using view methods</a></li>
-<li><a class="reference" href="#generating-html-from-python" id="id10">Generating HTML from Python</a></li>
-<li><a class="reference" href="#completely-python-driven-views" id="id11">Completely Python-driven views</a></li>
-<li><a class="reference" href="#doing-some-calculation-before-viewing-a-page" id="id12">Doing some calculation before viewing a page</a></li>
-<li><a class="reference" href="#reading-url-parameters" id="id13">Reading URL parameters</a></li>
-<li><a class="reference" href="#simple-forms" id="id14">Simple forms</a></li>
-<li><a class="reference" href="#a-view-for-a-model" id="id15">A view for a model</a></li>
-<li><a class="reference" href="#storing-data" id="id16">Storing data</a></li>
-<li><a class="reference" href="#redirection" id="id17">Redirection</a></li>
-<li><a class="reference" href="#showing-the-value-in-the-form" id="id18">Showing the value in the form</a></li>
-<li><a class="reference" href="#the-rules-of-persistence" id="id19">The rules of persistence</a></li>
-<li><a class="reference" href="#explicitly-associating-a-view-with-a-model" id="id20">Explicitly associating a view with a model</a></li>
-<li><a class="reference" href="#a-second-model" id="id21">A second model</a></li>
-<li><a class="reference" href="#containers" id="id22">Containers</a></li>
+<li><a class="reference" href="#welcome-to-the-grok-tutorial" id="id1" name="id1">Welcome to the Grok tutorial!</a></li>
+<li><a class="reference" href="#getting-started-with-grok" id="id2" name="id2">Getting started with Grok</a><ul>
+<li><a class="reference" href="#setting-up-grokproject" id="id3" name="id3">Setting up grokproject</a></li>
+<li><a class="reference" href="#creating-a-grok-project" id="id4" name="id4">Creating a grok project</a></li>
+<li><a class="reference" href="#starting-up-zope" id="id5" name="id5">Starting up Zope</a></li>
+<li><a class="reference" href="#an-empty-grok-project" id="id6" name="id6">An empty Grok project</a></li>
 </ul>
+</li>
+<li><a class="reference" href="#showing-pages" id="id7" name="id7">Showing pages</a><ul>
+<li><a class="reference" href="#publishing-a-simple-web-page" id="id8" name="id8">Publishing a simple web page</a></li>
+<li><a class="reference" href="#a-second-view" id="id9" name="id9">A second view</a></li>
+<li><a class="reference" href="#making-our-page-dynamic" id="id10" name="id10">Making our page dynamic</a></li>
+<li><a class="reference" href="#static-resources-for-our-web-page" id="id11" name="id11">Static resources for our web page</a></li>
+<li><a class="reference" href="#using-view-methods" id="id12" name="id12">Using view methods</a></li>
+<li><a class="reference" href="#generating-html-from-python" id="id13" name="id13">Generating HTML from Python</a></li>
+<li><a class="reference" href="#completely-python-driven-views" id="id14" name="id14">Completely Python-driven views</a></li>
+<li><a class="reference" href="#doing-some-calculation-before-viewing-a-page" id="id15" name="id15">Doing some calculation before viewing a page</a></li>
+<li><a class="reference" href="#reading-url-parameters" id="id16" name="id16">Reading URL parameters</a></li>
+<li><a class="reference" href="#simple-forms" id="id17" name="id17">Simple forms</a></li>
+</ul>
+</li>
+<li><a class="reference" href="#models" id="id18" name="id18">Models</a><ul>
+<li><a class="reference" href="#a-view-for-a-model" id="id19" name="id19">A view for a model</a></li>
+<li><a class="reference" href="#storing-data" id="id20" name="id20">Storing data</a></li>
+<li><a class="reference" href="#redirection" id="id21" name="id21">Redirection</a></li>
+<li><a class="reference" href="#showing-the-value-in-the-form" id="id22" name="id22">Showing the value in the form</a></li>
+<li><a class="reference" href="#the-rules-of-persistence" id="id23" name="id23">The rules of persistence</a></li>
+<li><a class="reference" href="#explicitly-associating-a-view-with-a-model" id="id24" name="id24">Explicitly associating a view with a model</a></li>
+<li><a class="reference" href="#a-second-model" id="id25" name="id25">A second model</a></li>
+<li><a class="reference" href="#containers" id="id26" name="id26">Containers</a></li>
+</ul>
+</li>
+</ul>
 </div>
+<div class="section">
+<h2><a class="toc-backref" href="#id1" id="welcome-to-the-grok-tutorial" name="welcome-to-the-grok-tutorial">Welcome to the Grok tutorial!</a></h2>
 <div class="sidebar">
 <p class="first sidebar-title">Getting started with Zope Page Templates</p>
 <p>You can find introductions and more information about Zope Page
@@ -74,20 +91,36 @@
 Zope 3 (and Grok) however; try reading <tt class="docutils literal"><span class="pre">context</span></tt> or <tt class="docutils literal"><span class="pre">view</span></tt>
 instead.</p>
 </div>
-<p>Welcome to the Grok tutorial! Grok is an extension to Zope 3 that
-makes it much quicker and easier to develop web applications with Zope
-3, <em>without</em> losing the power and flexibility of Zope 3 itself. Grok
-builds on existing Zope 3 technology like the component architecture
-but exposes it in a different way to the developer; a way which we
-believe makes developing with Zope 3 easier and more fun.</p>
-<p>In this tutorial we will show you the various things you can do with
-Grok. We'll start out simple, and will slowly go to more complex usage
-patterns. All you're expected to know is the Python programming
-language and an understanding of web programming. It also helps to be
-familiar with Zope Page Templates, though most of the examples should
-be fairly obvious even if you do not.</p>
-<div class="section" id="setting-up-grokproject">
-<h1><a class="toc-backref" href="#id1">Setting up grokproject</a></h1>
+<p>Grok is a powerful and flexible web application framework for Python developers.
+In this tutorial we will show you the various things you can do with Grok, and
+how Grok can help you build your web application. We'll start out simple, and
+will slowly go to more complex usage patterns.</p>
+<p>All you're expected to know is the Python programming language and an
+understanding of basic web programming (HTML, forms, URLs). It also
+helps if you are familiar with Zope Page Templates, though most of the
+examples should be fairly obvious if you are already familiar with
+another templating language.</p>
+<p>We recommend beginners to follow the tutorial from top to bottom. The
+tutorial is designed to explain important concepts in order and slowly
+builds up from there.</p>
+<p>If you are more experienced, or just curious, you may want to skip
+around instead and read the pieces which interest you most. If
+something is unclear, you can always backtrack to previous sections.</p>
+<p>Grok is based on Zope 3 and is compatible with Zope 3, but you do not
+need to know Zope 3 (or Zope 2) at all to follow this tutorial. Grok
+builds on existing Zope 3 technology but exposes it in a different way
+to the developer. We believe Grok makes developing with Zope 3
+technology easier and more fun for beginners and experienced
+developers alike.</p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id2" id="getting-started-with-grok" name="getting-started-with-grok">Getting started with Grok</a></h2>
+<p>This chapter will help you get up and running with Grok, using the
+<tt class="docutils literal"><span class="pre">grokproject</span></tt> tool. We create a new project with <tt class="docutils literal"><span class="pre">grokproject</span></tt>,
+tell you how to get that project running so you can access it with a
+web browser.</p>
+<div class="section">
+<h3><a class="toc-backref" href="#id3" id="setting-up-grokproject" name="setting-up-grokproject">Setting up grokproject</a></h3>
 <div class="sidebar">
 <p class="first sidebar-title">Installing <tt class="docutils literal"><span class="pre">easy_install</span></tt></p>
 <p>If you don't already have <tt class="docutils literal"><span class="pre">easy_install</span></tt> available, you can find the
@@ -122,8 +155,8 @@
 </pre>
 <p>We're ready to create our first grok project now!</p>
 </div>
-<div class="section" id="creating-a-grok-project">
-<h1><a class="toc-backref" href="#id2">Creating a grok project</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id4" id="creating-a-grok-project" name="creating-a-grok-project">Creating a grok project</a></h3>
 <p>Let's create a first Grok project. A Grok project is a working
 environment for a developer using Grok. In essence, a directory with a
 lot of files and subdirectories in it. Let's create a Grok project
@@ -183,8 +216,8 @@
 possibly Zope 3 and sets up the project environment for you.</p>
 <p>After all that, Grok, along with a Zope 3 instance, is ready to go.</p>
 </div>
-<div class="section" id="starting-up-zope">
-<h1><a class="toc-backref" href="#id3">Starting up Zope</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id5" id="starting-up-zope" name="starting-up-zope">Starting up Zope</a></h3>
 <p>You can go into the <tt class="docutils literal"><span class="pre">Sample</span></tt> project directory now:</p>
 <pre class="literal-block">
 $ cd Sample
@@ -227,8 +260,8 @@
 <cite>CTRL-c`</cite> and then <tt class="docutils literal"><span class="pre">parts/instance/bin/zopectl</span> <span class="pre">fg</span></tt> from your Sample
 project directory.</p>
 </div>
-<div class="section" id="an-empty-grok-project">
-<h1><a class="toc-backref" href="#id4">An empty Grok project</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id6" id="an-empty-grok-project" name="an-empty-grok-project">An empty Grok project</a></h3>
 <div class="sidebar">
 <p class="first sidebar-title">What about the other directories and files in our project?</p>
 <p class="last">What about the other files and subdirectories in our <tt class="docutils literal"><span class="pre">Sample</span></tt> project
@@ -295,14 +328,25 @@
 
 </pre>
 </div>
-<div class="section" id="publishing-a-simple-web-page">
-<h1><a class="toc-backref" href="#id5">Publishing a simple web page</a></h1>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id7" id="showing-pages" name="showing-pages">Showing pages</a></h2>
+<p>Showing web pages is what puts the <em>web</em> in &quot;web applications&quot;. You
+start doing this with HTML templates, but Grok doesn't stop at
+templates. Most web pages in a web application will contain complex
+presentation logic that is better handled by separate Python code in
+conjunction with templates. This becomes especially important in more
+complex interactions with the user, such as form handling. After
+reading this chapter, you should already be able to write simple web
+applications with Grok.</p>
+<div class="section">
+<h3><a class="toc-backref" href="#id8" id="publishing-a-simple-web-page" name="publishing-a-simple-web-page">Publishing a simple web page</a></h3>
 <p>Let's publish a simple static web page. Grok is geared towards web
 applications and therefore not really meant for publishing a large
 number of static (pregenerated) web pages. For that you're better off
-to use a specialized system such as Apache. But, to start a developing
-a web application we need to be able to put some simple HTML on the
-web, first.</p>
+to use a specialized system such as Apache. Nonetheless, in order to
+develop any web application we need to know how to put some simple
+HTML on the web.</p>
 <p>As you saw previously, our <tt class="docutils literal"><span class="pre">Sample</span></tt> application has a stock front
 page, generated by grokproject. Let's change that.</p>
 <p>To do this, go to the <tt class="docutils literal"><span class="pre">app_templates</span></tt> directory in <tt class="docutils literal"><span class="pre">src/sample/</span></tt>.
@@ -335,8 +379,8 @@
 for changes on the Python level, for instance when you add a
 template. We show an example of this next.</p>
 </div>
-<div class="section" id="a-second-view">
-<h1><a class="toc-backref" href="#id6">A second view</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id9" id="a-second-view" name="a-second-view">A second view</a></h3>
 <p>Our view is named <tt class="docutils literal"><span class="pre">index</span></tt>. This in fact means something slightly
 special: it's the default view of our application object. We can also
 access it explicitly by naming the view:</p>
@@ -361,7 +405,7 @@
 modify <tt class="docutils literal"><span class="pre">src/sample/app.py</span></tt> so that it reads like this:</p>
 <pre class="literal-block">
 import grok
-
+  
 class Sample(grok.Application, grok.Container):
     pass
 
@@ -395,8 +439,8 @@
 Bye world!
 </pre>
 </div>
-<div class="section" id="making-our-page-dynamic">
-<h1><a class="toc-backref" href="#id7">Making our page dynamic</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id10" id="making-our-page-dynamic" name="making-our-page-dynamic">Making our page dynamic</a></h3>
 <p>Static web pages are not very helpful if we want to make a dynamic web
 application. Let's make a page that shows the result of a very simple
 calculation: <tt class="docutils literal"><span class="pre">1</span> <span class="pre">+</span> <span class="pre">1</span></tt>.</p>
@@ -433,8 +477,8 @@
 <p>As you can see, the content of the <tt class="docutils literal"><span class="pre">&lt;p&gt;</span></tt> tag was indeed replaced
 with the result of the expression <tt class="docutils literal"><span class="pre">1</span> <span class="pre">+</span> <span class="pre">1</span></tt>.</p>
 </div>
-<div class="section" id="static-resources-for-our-web-page">
-<h1><a class="toc-backref" href="#id8">Static resources for our web page</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id11" id="static-resources-for-our-web-page" name="static-resources-for-our-web-page">Static resources for our web page</a></h3>
 <p>In real-world web pages, we almost never publish a web page that just
 contains bare-bones HTML. We also want to refer to other resources,
 such as images, CSS files or Javascript files. As an example, let's
@@ -491,8 +535,8 @@
 files and <cite>.js</cite> files in the <tt class="docutils literal"><span class="pre">static</span></tt> directory, and create the URL
 to them using <tt class="docutils literal"><span class="pre">static/&lt;filename&gt;</span></tt> in your page template.</p>
 </div>
-<div class="section" id="using-view-methods">
-<h1><a class="toc-backref" href="#id9">Using view methods</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id12" id="using-view-methods" name="using-view-methods">Using view methods</a></h3>
 <div class="sidebar">
 <p class="first sidebar-title">Unassociated templates</p>
 <p>If you have followed the tutorial so far, you will have an extra
@@ -597,8 +641,8 @@
 </pre>
 <p>Running this has the same result as before.</p>
 </div>
-<div class="section" id="generating-html-from-python">
-<h1><a class="toc-backref" href="#id10">Generating HTML from Python</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id13" id="generating-html-from-python" name="generating-html-from-python">Generating HTML from Python</a></h3>
 <p>While usually you will be using templates to generate HTML, sometimes
 you want to generate complicated HTML in Python and then include it in
 an existing web page. For reasons of security against cross-site
@@ -609,7 +653,7 @@
 this:</p>
 <pre class="literal-block">
 import grok
-
+  
 class Sample(grok.Application, grok.Container):
     pass
 
@@ -640,8 +684,8 @@
 &lt;b&gt;ME GROK BOLD&lt;/b&gt;
 </pre>
 </div>
-<div class="section" id="completely-python-driven-views">
-<h1><a class="toc-backref" href="#id11">Completely Python-driven views</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id14" id="completely-python-driven-views" name="completely-python-driven-views">Completely Python-driven views</a></h3>
 <div class="sidebar">
 <p class="first sidebar-title">Setting the content-type</p>
 <p>When generating the complete content of a page yourself, it's often
@@ -650,7 +694,7 @@
 the content type to <tt class="docutils literal"><span class="pre">text/xml</span></tt>:</p>
 <pre class="literal-block">
 import grok
-
+  
 class Sample(grok.Application, grok.Container):
     pass
 
@@ -671,7 +715,7 @@
 <p>Modify <tt class="docutils literal"><span class="pre">app.py</span></tt> so it reads like this:</p>
 <pre class="literal-block">
 import grok
-
+  
 class Sample(grok.Application, grok.Container):
     pass
 
@@ -701,8 +745,8 @@
 looking at the content type of this page, you will see that it is
 <tt class="docutils literal"><span class="pre">text/plain</span></tt>.</p>
 </div>
-<div class="section" id="doing-some-calculation-before-viewing-a-page">
-<h1><a class="toc-backref" href="#id12">Doing some calculation before viewing a page</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id15" id="doing-some-calculation-before-viewing-a-page" name="doing-some-calculation-before-viewing-a-page">Doing some calculation before viewing a page</a></h3>
 <p>Instead of calculating some values in a method call from the template,
 it is often more useful to calculate just before the web page's
 template is calculated. This way you are sure that a value is only
@@ -737,8 +781,8 @@
 <a class="reference" href="http://localhost:8080/test">http://localhost:8080/test</a></blockquote>
 <p>You should see 256, which is indeed 2 raised to the power 8.</p>
 </div>
-<div class="section" id="reading-url-parameters">
-<h1><a class="toc-backref" href="#id13">Reading URL parameters</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id16" id="reading-url-parameters" name="reading-url-parameters">Reading URL parameters</a></h3>
 <p>When developing a web application, you don't just want to output data,
 but also want to use input. One of the simplest ways for a web
 application to receive input is by retrieving information as a URL
@@ -799,8 +843,8 @@
 <p>Restart Zope, and see it can now deal with missing parameters (they
 default to <tt class="docutils literal"><span class="pre">0</span></tt>).</p>
 </div>
-<div class="section" id="simple-forms">
-<h1><a class="toc-backref" href="#id14">Simple forms</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id17" id="simple-forms" name="simple-forms">Simple forms</a></h3>
 <div class="sidebar">
 <p class="first sidebar-title">Automatic forms</p>
 <p class="last">Creating forms and converting and validating user input by hand, as
@@ -871,8 +915,18 @@
 <blockquote>
 <a class="reference" href="http://localhost:8080/test">http://localhost:8080/test</a></blockquote>
 </div>
-<div class="section" id="a-view-for-a-model">
-<h1><a class="toc-backref" href="#id15">A view for a model</a></h1>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id18" id="models" name="models">Models</a></h2>
+<p>Now we know how to show web pages, we need to go into what we are
+actually showing: the models. The models contain the
+display-independent logic of your application. In this chapter we will
+discuss a number of issues surrounding models: how your views connect
+to models, and how you can make sure the data in your models is stored
+safely. As the complexity of our sample applications grows, we will
+also go into a few more issues surrounding form handling.</p>
+<div class="section">
+<h3><a class="toc-backref" href="#id19" id="a-view-for-a-model" name="a-view-for-a-model">A view for a model</a></h3>
 <p>So far, we have only seen views that do the work all by themselves.
 In typical applications this is not the case however - views display
 information that is stored elsewhere. In Grok applications, views work
@@ -977,8 +1031,8 @@
 <p>The information, reversed: !noitamrofni tnatropmi si sihT</p>
 </blockquote>
 </div>
-<div class="section" id="storing-data">
-<h1><a class="toc-backref" href="#id16">Storing data</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id20" id="storing-data" name="storing-data">Storing data</a></h3>
 <p>So far we have only displayed either hardcoded data, or calculations
 based on end-user input. What if we actually want to <em>store</em> some
 information, such as something the user entered? The easiest way to do
@@ -1055,8 +1109,8 @@
 <p>You can even restart Zope and go back to the index page, and your text
 should still be there.</p>
 </div>
-<div class="section" id="redirection">
-<h1><a class="toc-backref" href="#id17">Redirection</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id21" id="redirection" name="redirection">Redirection</a></h3>
 <p>Let's make our application a bit easier to use. First, let's change
 <tt class="docutils literal"><span class="pre">index.pt</span></tt> so it includes a link to the edit page. To do this, we
 will use the <tt class="docutils literal"><span class="pre">url</span></tt> method on the view:</p>
@@ -1097,8 +1151,8 @@
 special method available on all <tt class="docutils literal"><span class="pre">grok.View</span></tt> subclasses,
 <tt class="docutils literal"><span class="pre">redirect</span></tt>. We tell the system to redirect to the <tt class="docutils literal"><span class="pre">index</span></tt> page.</p>
 </div>
-<div class="section" id="showing-the-value-in-the-form">
-<h1><a class="toc-backref" href="#id18">Showing the value in the form</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id22" id="showing-the-value-in-the-form" name="showing-the-value-in-the-form">Showing the value in the form</a></h3>
 <p>Let's change our application so it displays what we stored the edit
 form as well, not just on the index page.</p>
 <p>To make this work, change edit.pt so it reads like this:</p>
@@ -1116,8 +1170,8 @@
 <p>The only change is that we have used <tt class="docutils literal"><span class="pre">tal:attributes</span></tt> to include the
 value of the <tt class="docutils literal"><span class="pre">text</span></tt> attribute of the context object in the form.</p>
 </div>
-<div class="section" id="the-rules-of-persistence">
-<h1><a class="toc-backref" href="#id19">The rules of persistence</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id23" id="the-rules-of-persistence" name="the-rules-of-persistence">The rules of persistence</a></h3>
 <p>These are the &quot;rules of persistence&quot;:</p>
 <ul class="simple">
 <li>You should subclass classes that want to store data from
@@ -1155,7 +1209,7 @@
     def __init__(self):
         super(Sample, self).__init__()
         self.list = []
-
+    
 class Index(grok.View):
     pass
 
@@ -1285,7 +1339,7 @@
     def __init__(self):
         super(Sample, self).__init__()
         self.list = []
-
+    
 class Index(grok.View):
     pass
 
@@ -1321,7 +1375,7 @@
     def addText(self, text):
         self.list.append(text)
         self._p_changed = True
-
+        
 class Index(grok.View):
     pass
 
@@ -1339,8 +1393,8 @@
 to worry about the rules of persistence itself, as that is the model's
 responsibility.</p>
 </div>
-<div class="section" id="explicitly-associating-a-view-with-a-model">
-<h1><a class="toc-backref" href="#id20">Explicitly associating a view with a model</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id24" id="explicitly-associating-a-view-with-a-model" name="explicitly-associating-a-view-with-a-model">Explicitly associating a view with a model</a></h3>
 <p>How does Grok know that a view belongs to a model? In the previous
 examples, Grok has made this association automatically. Grok could do
 this because there was only a single model defined in the module
@@ -1359,7 +1413,7 @@
 the use of <tt class="docutils literal"><span class="pre">grok.context</span></tt>:</p>
 <pre class="literal-block">
 import grok
-
+  
 class Sample(grok.Application, grok.Container):
     pass
 
@@ -1368,9 +1422,9 @@
 
 class Bye(grok.View):
     grok.context(Sample)
+    
 
 
-
 </pre>
 <p>This code behaves in exactly the same way as the previous example in
 <cite>A second view</cite>, but has the relationship between the model and the
@@ -1378,8 +1432,8 @@
 <p><tt class="docutils literal"><span class="pre">grok.context</span></tt> is just one class annotation out of many. We will see
 another one (<tt class="docutils literal"><span class="pre">grok.name</span></tt>) in the next section.</p>
 </div>
-<div class="section" id="a-second-model">
-<h1><a class="toc-backref" href="#id21">A second model</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id25" id="a-second-model" name="a-second-model">A second model</a></h3>
 <div class="sidebar">
 <p class="first sidebar-title">How to combine models into a single application?</p>
 <p class="last">Curious now about how to combine models into a single application?
@@ -1395,7 +1449,7 @@
 this:</p>
 <pre class="literal-block">
 import grok
-
+  
 class Sample(grok.Application, grok.Container):
     pass
 
@@ -1405,7 +1459,7 @@
 class SampleIndex(grok.View):
     grok.context(Sample)
     grok.name('index')
-
+    
 class AnotherIndex(grok.View):
     grok.context(Another)
     grok.name('index')
@@ -1467,8 +1521,8 @@
 to structure your application so you can use Grok's default
 conventions.</p>
 </div>
-<div class="section" id="containers">
-<h1><a class="toc-backref" href="#id22">Containers</a></h1>
+<div class="section">
+<h3><a class="toc-backref" href="#id26" id="containers" name="containers">Containers</a></h3>
 <p>A container is a special kind of model object that can contain other
 objects. Our <tt class="docutils literal"><span class="pre">Sample</span></tt> application is already a container, as it
 subclasses <tt class="docutils literal"><span class="pre">grok.Container</span></tt>. What we will do in this section is
@@ -1538,7 +1592,7 @@
          tal:content=&quot;python:key&quot;&gt;&lt;/a&gt;
     &lt;/li&gt;
   &lt;/ul&gt;
-
+ 
   &lt;h2&gt;Add a new entry&lt;/h2&gt;
   &lt;form tal:attributes=&quot;action python:view.url()&quot; method=&quot;POST&quot;&gt;
     Name: &lt;input type=&quot;text&quot; name=&quot;name&quot; value=&quot;&quot; /&gt;&lt;br /&gt;
@@ -1587,14 +1641,13 @@
 modifications, you would be on your way to building your own content
 management system with Grok.</p>
 </div>
+</div>
 
-	</div>
+  </div>
 
-<div class="roundbottom">
-	 <img src="./resources/corner-bottomleft.jpg" alt="" 
-	 width="45" height="45" class="corner" 
-	 style="display: none" />
-</div>
+  <div class="roundbottom">
+     <img src="./resources/corner-bottomleft.jpg" alt="" width="45" height="45" class="corner" style="display: none" />
+  </div>
 
 </div>
 
@@ -1612,6 +1665,6 @@
 	<p>Hosting provided by <a href="http://quintagroup.com/"><b>Quintagroup</b></a></p>
 </div>
 
-
 </body>
 </html>
+



More information about the Checkins mailing list