def newStory(): if request.method == 'GET': return render_template('newstory.html') else: name = request.form["title"] #name = "BH" lines = request.form["lines"] #lines = "lines" database.addStory(name) database.addLine(name, lines) url=urllib2.quote('/story/%s'%(name)) return redirect(url)
def story(story): #story = database.getStory(story) # if request.method == 'POST': # line = request.form['newLine'] # database.addLine(story, line) # lastline = database.getLastLine(story) #return render_template('story', title=story, lastline=lastline) #return render_template("story.html",title=story,lastline=lastline.get_lastline(story)) if request.method == 'GET': return render_template('story.html', title = story , lastline =database.getLastLine(story)) else: line = request.form['newLine'] database.addLine(story, line) url=urllib2.quote('/story/%s'%(story)) return redirect(url)