<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -137,16 +137,9 @@ class BaseHandler(tornado.web.RequestHandler):
 
 class HomeHandler(BaseHandler):
     def get(self):
-        start = self.get_integer_argument(&quot;start&quot;, 0)
-        entries = db.Query(Entry).order(&quot;-published&quot;).fetch(limit=5,
-            offset=start)
-        if not entries and start &gt; 0:
-            self.redirect(&quot;/&quot;)
-            return
-        next = max(start - 5, 0)
-        previous = start + 5 if len(entries) == 5 else None
-        self.render(&quot;home.html&quot;, entries=entries, start=start, next=next,
-            previous=previous) 
+        entries = db.Query(Entry).order(&quot;-published&quot;).fetch(limit=5)
+        self.recent_entries = entries
+        self.render(&quot;home.html&quot;, entries=entries)
 
 
 class AboutHandler(BaseHandler):
@@ -157,6 +150,7 @@ class AboutHandler(BaseHandler):
 class ArchiveHandler(BaseHandler):
     def get(self):
         entries = db.Query(Entry).order(&quot;-published&quot;)
+        self.recent_entries = entries[:5]
         self.render(&quot;archive.html&quot;, entries=entries)
 
 
@@ -280,7 +274,8 @@ class EntrySmallModule(tornado.web.UIModule):
 
 class RecentEntriesModule(tornado.web.UIModule):
     def render(self):
-        entries = db.Query(Entry).order(&quot;-published&quot;).fetch(limit=5)
+        entries = getattr(self.handler, &quot;recent_entries&quot;, 
+            db.Query(Entry).order(&quot;-published&quot;).fetch(limit=5))
         return self.render_string(&quot;modules/recententries.html&quot;, entries=entries)
 
 </diff>
      <filename>blog.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7c5ca9d36796390563d36977e97410e6a540097e</id>
    </parent>
  </parents>
  <author>
    <name>Benjamin Golub</name>
    <email>bgolub@benjamingolub.com</email>
  </author>
  <url>http://github.com/bgolub/tornado-blog/commit/cbfc31b5bdb446a8354ad5572e15ce2ec12dff0e</url>
  <id>cbfc31b5bdb446a8354ad5572e15ce2ec12dff0e</id>
  <committed-date>2009-09-30T17:49:21-07:00</committed-date>
  <authored-date>2009-09-30T17:49:21-07:00</authored-date>
  <message>no paging, simple caching of recent entries per request</message>
  <tree>fe24dbe45dac0a04fec3b38860a8e99c74fcdcdf</tree>
  <committer>
    <name>Benjamin Golub</name>
    <email>bgolub@benjamingolub.com</email>
  </committer>
</commit>
