def randomStory(): everything = module.getAllPosts() number = random.randint(0, len(everything) - 1) title = everything[number][1] str = '<meta http-equiv="refresh" content="0; /story/%s" />' % title lin = Markup(str) return render_template("forward.html", link=lin)
def randomStory(): everything=module.getAllPosts() number=random.randint(0,len(everything)-1) title=everything[number][1] str='<meta http-equiv="refresh" content="0; /story/%s" />' % title lin=Markup(str) return render_template("forward.html", link=lin)
def stories(): #generates html for displaying the title as a link str = "" stories = module.getAllPosts() for item in stories: str += "<h1> <a href='story/%s'> %s</a> </h1>" % (item[1], item[1]) #str+="<h2> Posted by: %s </h2>" %item[0] str += "<h3> %s </h3>" % item[2] + "<hr>" str = Markup(str) return render_template("stories.html", link=str)
def stories(): #generates html for displaying the title as a link str="" stories=module.getAllPosts() for item in stories: str+="<h1> <a href='story/%s'> %s</a> </h1>" %(item[1], item[1]) #str+="<h2> Posted by: %s </h2>" %item[0] str+="<h3> %s </h3>" %item[2] + "<hr>" str= Markup(str) return render_template("stories.html", link=str)