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): # retrieve data from request # form.netid - friend's netid to remove from queue form = web.input(netid = "netid") # find the corresponding columns within the sheet Friend-List sheet = cv.open_sheet('Friend-List') name_col = cv.search_row(sheet, 1, 'name') netid_col = cv.search_row(sheet, 1, 'netid') row_num = cv.search_column(sheet, netid_col, form.netid) #this wont work if we have more than 950 entries. #thats ALOOOOOOT of people on the queue if row_num < 950: # find the name of the user within the sheet name_values = sheet.col_values(name_col) name = name_values[row_num - 1] # remove the user from the queue cv.remove_from_queue("Friend-Q", name, 'rm all') choice = 2 else: #cant find netid error message choice = 3 # render /remove return render.remove(option = choice)
def POST(self): # retrieve data from request # form.netid - friend's netid to remove from queue form = web.input(netid = "netid") # find the corresponding columns within the sheet Friend-List sheet = cv.open_sheet('Friend-List') name_col = cv.search_row(sheet, 1, 'name') netid_col = cv.search_row(sheet, 1, 'netid') row_num = cv.search_column(sheet, netid_col, form.netid) #this wont work if we have more than 950 entries. #thats ALOOOOOOT of people on the queue if row_num < 950: # find the name of the user within the sheet name_values = sheet.col_values(name_col) name = name_values[row_num - 1] # remove the user from the queue cv.remove_from_queue("Friend-Q", name, form.netid, 'rm all') choice = 2 else: #cant find netid error message choice = 3 # render /remove return render.remove(option = choice)
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