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_person(name, role): if role == 'students': people = get_people() people['students'].append(name) write_people(people) redirect('/added/' + name + '/' + role) elif role == 'teachers': people = get_people() people['teachers'].append(name) write_people(people) redirect('/added/' + name + '/' + role) elif role == 'staff': people = get_people() people['staff'].append(name) write_people(people) redirect('/added/' + name + '/' + role) else: redirect('/')
def form_edit_person(): people = get_people() teachers = people['teachers'] staff = people['staff'] students = people['students'] return template('edit_person',teachers=teachers,staff=staff,students=students)