Commits

jokull  committed 540e127

Latest entries powered by compiled view.

  • Participants
  • Parent commits dccd726

Comments (0)

Files changed (2)

File relaxlog/templates/base.html

         </div>
         <p id="footer">
             Höfundarréttur &copy; <a href="/">Jökull Sólberg Auðunsson</a>. 
-            Meira <a href="/jokull/">um höfundinn</a> eða <a href="/meira-um/solberg-is/">þessa síðu</a>.
+            Meira <a href="/meira-um/hofundinn/">um höfundinn</a> eða <a href="/meira-um/solberg-is/">þessa síðu</a>.
         </p>
     </div>
 </body>

File relaxlog/weblog/views.py

     server = client.Server()
     db = server[settings.COUCHDB_DATABASE]
     options = {'count': 5, 'descending': True, }
-    startkey = request.GET.get('startkey', None),
-    if startkey is not None: options.update(startkey=startkey)
-    latest_articles = db.query("""function(doc){
-      if(doc.type=="Article" && doc.status=="Online")
-          emit(doc.date, doc);
-    }""", **options)
+    startkey = request.GET.get('startkey', None)
+    if startkey is not None: 
+        options['startkey'] = startkey
+    latest_articles = db.view('blog/latest_articles', **options)
     return response(request, 'weblog/latest.html', {'latest_articles': latest_articles.rows })