예제 #1
0
def home():
    global myTitle
    if request.method == "GET":
        return render_template("form.html", 
                               titles = mongo.getTitles())
    if request.method == "POST":
        if request.form["button"] == "View Story":
            myTitle = str(request.form['select'])
            return redirect(url_for('story'))
        if request.form["button"] == "Create Story":
            myTitle = str(request.form['newTitle'])
            mongo.newStory(myTitle)
            return redirect(url_for('story'))
예제 #2
0
    #we will test our methods am i right!?

#    mongo.newStory("Jets")
 #   mongo.addLine("Jets" , "The Jets lost today...again.")


#if __name__=="__main__":
#    testing123()
#

import pymongo
from pymongo import Connection
import mongo

mongo.deleteAll()
mongo.newStory("story1")
mongo.addLine("story1", "lets go mets")
mongo.addLine("story1", "lets go yankees")
mongo.newStory("story2")

print "\nTesting PrintLines"
mongo.printLines("story1")
"""
x = []
x = mongo.getTitles()
for x in n:
    print x
"""
x = []
print "\nTesting getTitles()"
x = mongo.getTitles()
예제 #3
0
def testing123():
    #we will test our methods am i right!?

    mongo.newStory("Jets")
    mongo.addLine("Jets" , "The Jets lost today...again.")