def storynatorHome(): global title if request.method=='GET': return render_template("storynatorHome.html", titles = db.getStories()) if request.method=='POST': if request.form["button"]=="Select": title = str(request.form["storyPicked"]) lines = db.getLines(title) #return render_template("storypage.html", title = title, lines = lines) return redirect(url_for("storypage")) if request.form["button"]=="Drop": db.dropStory(str(request.form["storyPicked"])) return render_template("storynatorHome.html", titles = db.getStories()) if request.form["button"]=="Create": db.addStory(str(request.form["newTitle"])) return render_template("storynatorHome.html", titles = db.getStories())
def __init__(self, article, conn): #print 'new story' + str(article) self.items = [] self.title = article.title.text self.items.append(article) self.text = article.article.text self.desc = article.desc.text self.storyID = db.addStory(self.title, self.text, self.desc, conn)