def _delete(self, id): c.schedule = Schedule.find_by_id(id) meta.Session.delete(c.schedule) meta.Session.commit() h.flash("Schedule has been deleted.") redirect_to('index')
def delete(self, id): """Delete the schedule GET will return a form asking for approval. POST requests will delete the item. """ c.schedule = Schedule.find_by_id(id) return render('/schedule/confirm_delete.mako')
def _edit(self, id): schedule = Schedule.find_by_id(id) for key in self.form_result['schedule']: setattr(schedule, key, self.form_result['schedule'][key]) # update the objects with the validated form data meta.Session.commit() h.flash("The Schedule has been updated successfully.") redirect_to(action='index', id=None)
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 table_view(self, id): c.schedlue = Schedule.find_by_id(id) return render('/schedule/table_view.mako')