index.py
branchxbelweb
changeset 17 14bec94bbe89
parent 15 574631f841c3
child 21 345ee7421989
--- a/index.py	Fri Sep 26 11:03:02 2003 -0400
+++ b/index.py	Fri Sep 26 11:04:15 2003 -0400
@@ -40,6 +40,19 @@
 def get_curl():
 	return urljoin( 'http://' + environ["HTTP_HOST"] + environ["REQUEST_URI"], 'add.py')
 
+def load_index(db):
+    	kw = db.get_all_keywords()
+	kw = set_selection(kw, [])
+    	total = kw[0]['count']
+    	kw = kw[1:]
+    	exc = map(lambda e: int(e['id']), kw)
+    	bookmarks = db.select_bookmarks([0], exc)
+	if len(bookmarks)>0:
+    		bookmarks = db.get_bookmarks(map(lambda x: x[0], bookmarks))
+    	bookmarks = map(lambda bk: bk.dict(), bookmarks)
+    	curl = get_curl();
+    	main(bookmarks, kw, curl, total)
+
 def main(bk, kw, curl, total):
     tmpl = TemplateManager().prepare("index.tmpl")
     tproc = TemplateProcessor()