def POST(self): #recieve friend and warrior name to be paired from request form = web.input(friend = 'friend', warrior = 'warrior', pb = 'pb', notes = 'notes') # remove the friend and warrior from respective # queues as they have been paired cv.remove_from_queue("Friend-Q", form.friend) cv.remove_from_queue("Warrior-Q", form.warrior) # add the paired friend and warrior to the paired spreadsheet # as well as who paired them chosen_pair = [form.warrior, form.friend] cv.add_pair(chosen_pair, form.pb, form.notes) # retrieve contact information for the friend and # warrior to display to pairing committee member friendContact = cv.get_friend_info(form.friend, 'contact') warriorContact = cv.get_warrior_info(form.warrior, 'contact') #dont need to display updated, plus this saves time #retrieve queues to display updated versions. #friendq = cv.names_no_null("Friend-Q", 1) #warriorq = cv.names_no_null("Warrior-Q", 1) friendq = ["None"] warriorq = ["None"] # create a single object to pass to /display webpage and render /display this = [chosen_pair, friendq, warriorq, friendContact, warriorContact] return render.display(this) """all_lists should be of the form
def POST(self): warriorName = web.input() textName = warriorName['name'] info = cv.get_warrior_info(textName, 'info') return json.dumps({'sex' :info[0], 'year' : info[1], 'interests' :info[2], 'hobbies' : info[3], 'struggle' :info[4]})
def POST(self): #recieve friend and warrior name to be paired from request form = web.input(friend = 'friend', warrior = 'warrior', pb = 'pb', notes = 'notes') sheet = cv.open_sheet("Friend-List") name = cv.id2name(sheet, form.friend) # remove the friend and warrior from respective # queues as they have been paired # doesnt use name for friend q currently, and hopefully futurely too cv.remove_from_queue("Friend-Q", name, form.friend) cv.remove_from_queue("Warrior-Q", form.warrior) # add the paired friend and warrior to the paired spreadsheet # as well as who paired them chosen_pair = [form.warrior, name] cv.add_pair(chosen_pair, form.pb, form.notes) # retrieve contact information for the friend and # warrior to display to pairing committee member friendContact = cv.get_friend_info(name, 'contact') warriorContact = cv.get_warrior_info(form.warrior, 'contact') #dont need to display updated, plus this saves time #retrieve queues to display updated versions. #friendq = cv.names_no_null("Friend-Q", 1) #warriorq = cv.names_no_null("Warrior-Q", 1) friendq = ["None"] warriorq = ["None"] # create a single object to pass to /display webpage and render /display this = [chosen_pair, friendq, warriorq, friendContact, warriorContact] return render.display(this) """all_lists should be of the form