def POST(self): """ This function checks to see if the player has chosen a story and if they have the story choice is saved. Parameters: None Returns: None """ playerStateObject = PlayerState() action = web.input() if action['story']=="back": raise web.seeother('/') else: title=action['story'] story_id=DBManager.getStoryIDFromTitle(title) DBManager.insertPlayerStoryAction(playerStateObject.player_id,story_id) raise web.seeother('/game')
def POST(self): """ This function checks to see if the player has chosen a story and if they have the story choice is saved. Parameters: None Returns: None """ playerStateObject = PlayerState() #Updating the player state action = web.input() #Creating web.input() object to save any from data input by the user if action['story']== "back": #Checks to see if the player pressed the back button raise web.seeother('/home') #If the above is true then the charScreen.html is rendered else: title= action['story'] story_id=DBManager.getStoryIDFromTitle(title) print story_id DBManager.insertPlayerStoryAction(playerStateObject.player_id,story_id) #If the above is true the story selection is inserted into the database raise web.seeother('/game') #Rendering gameScreen.html