[Checkins] SVN: grokapps/gbeguestbook/REVIEW.txt add model code samples

Michael Haubenwallner michael at d2m.at
Fri Aug 15 12:18:04 EDT 2008


Log message for revision 89884:
  add model code samples

Changed:
  U   grokapps/gbeguestbook/REVIEW.txt

-=-
Modified: grokapps/gbeguestbook/REVIEW.txt
===================================================================
--- grokapps/gbeguestbook/REVIEW.txt	2008-08-15 13:44:40 UTC (rev 89883)
+++ grokapps/gbeguestbook/REVIEW.txt	2008-08-15 16:18:00 UTC (rev 89884)
@@ -10,7 +10,7 @@
 __ http://code.google.com/p/googleappengine/source/browse/trunk/demos/guestbook/guestbook.py
 
 Overview
-========
+~~~~~~~~
 
 The application presents you a list of 10 guestbook entries both by 
 authenticated and anonymous users, reverse sorted by date of creation
@@ -18,9 +18,9 @@
 formatting is done using python string templates only.
 
 Review
-======
+~~~~~~
 
-Let's now compare how the code is layed out for both frameworks:
+Let's now compare how the code is laid out for both frameworks:
 
 Application object
 ------------------
@@ -98,11 +98,21 @@
 ------
 
 Grok content objects are subclassed from grok.Model. Properties are
-defined in an Interface class which the object implements.
+defined in an Interface class which the object implements::
 
+    class IGreeting(Interface):
+        author = schema.Field(title=u'Author')
+        ...
+
+    class Greeting(grok.Model):
+        grok.implements(IGreeting)
+    
 GAE uses the db.Model class to define content objects.
-Typed properties are defined inside the class definition.
+Typed properties are defined inside the class definition::
 
+    class Greeting(db.Model):
+      author = db.UserProperty()
+
 Persistency
 -----------
 



More information about the Checkins mailing list