def new(self): c.time_slots = TimeSlot.find_all() c.locations = Location.find_all() c.events = Event.find_all() form = render('/schedule/new.mako') object = { 'schedule': self.form_result } defaults = NewScheduleSchema().from_python(object) return htmlfill.render(form, defaults)
def edit(self, id): c.time_slots = TimeSlot.find_all() c.locations = Location.find_all() c.events = Event.find_all() c.schedule = Schedule.find_by_id(id) defaults = h.object_to_defaults(c.schedule, 'schedule') defaults['schedule.time_slot'] = c.schedule.time_slot_id defaults['schedule.location'] = c.schedule.location_id defaults['schedule.event'] = c.schedule.event_id form = render('/schedule/edit.mako') return htmlfill.render(form, defaults)
def index(self): c.location_collection = Location.find_all() return render('/location/list.mako')