def create_get(): devices = get_data().keys() staff = get_people()['staff'] teachers = get_people()['teachers'] students = get_people()['students'] locations = get_location() dataFields = ['Router','Switch','Barrix','Software - Individual', 'Software - Subscription','Hub','Desktop Computer','Laptop','Projector','Speakers','Television - CRT', 'Television - LCD', 'Phone', 'DVD Player', 'VCR', 'Printer', 'Other'] return template('generate', dataFields=dataFields, devices=devices, staff=staff, teachers=teachers, students=students, locations=locations)
def add_location(name): whileLoop = 0 while whileLoop == 0: name = str(name) locations = get_location() locations.append(name) write_location(locations) whileLoop = 1 redirect('/')
def del_location(name): whileLoop = 0 while whileLoop == 0: name = str(name) if "_" in name: name = name.replace("_"," ") locations = list(get_location()) locations.remove(name) write_location(locations) whileLoop = 1 redirect('/')
def form_del_location(): Locations = get_location() return template('del_location', POSTURL="/del/location", locations=Locations)