 <pre><code>class Greeting(db.Model): author = db.UserProperty() content = db.StringProperty(multiline=True) date = db.DateTimeProperty(auto_now_add=True) </code></pre> <p>This code instructs the ORM (object relational mapper) to create a table in the database with the fields "author", "content" and "date". Notice how class Greeting is inherited from db.Model: It's a model for a table to be created in the database.</p> <pre><code>class Guestbook(webapp.RequestHandler): def post(self): greeting = Greeting() if users.get_current_user(): greeting.author = users.get_current_user() greeting.content = self.request.get('content') greeting.put() self.redirect('/') </code></pre> <p>Guestbook is a request handler (notice which class it's inherited from). The post() method of a request handler is called on the event of a POST request. There can be several other methods in this class as well to handle different kinds of requests. Now notice what the post method does: It instantiates the Greeting class- we now have an instance, greeting object. Next, the "author" and "content" of the greeting object are set from the request information. Finally, greeting.put() writes to the database. Additionally, note that "date" is also set automatically to the date/time of writing the object to the database.</p>