[Checkins] SVN: five.grok/trunk/src/five/grok/README.txt first
english sentences ; -)
Godefroid Chapelle
gotcha at bubblenet.be
Fri Jul 18 12:48:54 EDT 2008
Log message for revision 88532:
first english sentences ;-)
Changed:
U five.grok/trunk/src/five/grok/README.txt
-=-
Modified: five.grok/trunk/src/five/grok/README.txt
===================================================================
--- five.grok/trunk/src/five/grok/README.txt 2008-07-18 16:30:30 UTC (rev 88531)
+++ five.grok/trunk/src/five/grok/README.txt 2008-07-18 16:48:53 UTC (rev 88532)
@@ -9,17 +9,21 @@
How-to
------
-This readme try to explain you how to use grok in Zope 2.
+This text explains you how to use grok constructs in Zope 2.
<<< from five import grok
<<< from OFS.ObjectManager import ObjectManager
<<< from OFS.SimpleItem import Item
+Let's make a Folder as a base class...
+
<<< class SimpleFolder(ObjectManager, Item):
... def __init__(self, id=None):
... if id is not None:
... self.id = str(id)
+and use it to define our own business object.
+
<<< class GrokVillage(SimpleFolder):
...
... def addCave(self, id):
@@ -27,7 +31,13 @@
... self._setObject(id, cave)
... return cave
+Let's define a directory that will hold the templates
+that grok will use with our views.
+
<<< grok.templatedir('tests/all/all_test_templates')
+
+Let's create a view on the GrokVillage.
+
<<< class GrokVillageView(grok.View):
... grok.context(GrokVillage)
...
More information about the Checkins
mailing list