def store(self, link, title, tags_string): tags_string = sp2sl(tags_string) if self.storage.has_key(tags_string): self.storage[tags_string].add(link) else: self.storage[tags_string] = set() self.storage[tags_string].add(link)
def post(self, link='', title='', tags_string=''): tags_string = sp2sl(tags_string) if link: db.store(link, title, tags_string) raise cherrypy.InternalRedirect(tags_string) #tmpl = lookup.get_template("index.html") #links = db.retrieve(tags_string) #all_links = '' #for link in links: # all_links = all_links + '<p>' + link + '</p>' #return tmpl.render(title="TITLE", body=all_links) else: tmpl = lookup.get_template("post.html") return tmpl.render(title="TITLE")