First you make an index page containing all the items you want to show
based on a filtering, maybe date.

class ItemIndexPage(webapp.RequestHandler):
  def get(self):
    items = Item.all().filter(...some filter...).fetch(1000)
    self.response.out.write("<ol>")
    for item in items:
        self.response.out.write("""<li><a href="%s">%s</a><br />
<a href="/item/%s">comments</a></li> """ %
                                   (cgi.escape(item.url),
cgi.escape(item.title), cgi.escape(item.key().id())))
    self.response.out.write("</ol>")

And deal with the individual item in the next handler

class ItemPage(webapp.RequestHandler):
  def get(self, id):
    id = int(id)
    item = Item.get_by_id(id)
    # rest of the handler

application = webapp.WSGIApplication([('/items',
ItemIndexPage)],('/item/(\d+)', ItemPage)],
                                    debug=True)

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to