def _delete(self, id): c.time_slot = TimeSlot.find_by_id(id) meta.Session.delete(c.time_slot) meta.Session.commit() h.flash("Time Slot has been deleted.") redirect_to('index')
def _delete(self, id): c.time_slot = TimeSlot.find_by_id(id) meta.Session.delete(c.time_slot) meta.Session.commit() h.flash("Time Slot has been deleted.") redirect_to('index')
def delete(self, id): """Delete the time_slot GET will return a form asking for approval. POST requests will delete the item. """ c.time_slot = TimeSlot.find_by_id(id) return render('/time_slot/confirm_delete.mako')
def delete(self, id): """Delete the time_slot GET will return a form asking for approval. POST requests will delete the item. """ c.time_slot = TimeSlot.find_by_id(id) return render('/time_slot/confirm_delete.mako')
def edit(self, id): c.time_slot = TimeSlot.find_by_id(id) defaults = h.object_to_defaults(c.time_slot, 'time_slot') defaults['time_slot.start_date'] = c.time_slot.start_time.strftime('%d/%m/%y') defaults['time_slot.start_time'] = c.time_slot.start_time.strftime('%H:%M:%S') defaults['time_slot.end_date'] = c.time_slot.end_time.strftime('%d/%m/%y') defaults['time_slot.end_time'] = c.time_slot.end_time.strftime('%H:%M:%S') form = render('/time_slot/edit.mako') return htmlfill.render(form, defaults)
def edit(self, id): c.time_slot = TimeSlot.find_by_id(id) defaults = h.object_to_defaults(c.time_slot, 'time_slot') defaults['time_slot.start_date'] = c.time_slot.start_time.strftime( '%d/%m/%Y') defaults['time_slot.start_time'] = c.time_slot.start_time.strftime( '%H:%M') defaults['time_slot.end_date'] = c.time_slot.end_time.strftime( '%d/%m/%Y') defaults['time_slot.end_time'] = c.time_slot.end_time.strftime('%H:%M') form = render('/time_slot/edit.mako') return htmlfill.render(form, defaults)
def _edit(self, id): time_slot = TimeSlot.find_by_id(id) for key in self.form_result['time_slot']: setattr(time_slot, key, self.form_result['time_slot'][key]) results = self.form_result['time_slot'] time_slot.start_time=datetime.combine(results['start_date'], results['start_time']) time_slot.end_time=datetime.combine(results['end_date'], results['end_time']) # update the objects with the validated form data meta.Session.commit() h.flash("The Time Slot has been updated successfully.") redirect_to(action='index', id=None)
def _edit(self, id): time_slot = TimeSlot.find_by_id(id) for key in self.form_result['time_slot']: setattr(time_slot, key, self.form_result['time_slot'][key]) results = self.form_result['time_slot'] time_slot.start_time = datetime.combine(results['start_date'], results['start_time']) time_slot.end_time = datetime.combine(results['end_date'], results['end_time']) # update the objects with the validated form data meta.Session.commit() h.flash("The Time Slot has been updated successfully.") redirect_to(action='index', id=None)
def view(self, id): c.time_slot = TimeSlot.find_by_id(id) return render('/time_slot/view.mako')
def view(self, id): c.time_slot = TimeSlot.find_by_id(id) return render('/time_slot/view.mako')