def edit(self, id): c.location = Location.find_by_id(id) defaults = h.object_to_defaults(c.location, 'location') form = render('/location/edit.mako') return htmlfill.render(form, defaults)
def _delete(self, id): c.location = Location.find_by_id(id) meta.Session.delete(c.location) meta.Session.commit() h.flash("Location has been deleted.") redirect_to('index')
def delete(self, id): """Delete the location GET will return a form asking for approval. POST requests will delete the item. """ c.location = Location.find_by_id(id) return render('/location/confirm_delete.mako')
def _edit(self, id): location = Location.find_by_id(id) for key in self.form_result['location']: setattr(location, key, self.form_result['location'][key]) # update the objects with the validated form data meta.Session.commit() h.flash("The Location has been updated successfully.") redirect_to(action='index', id=None)
def view(self, id): c.location = Location.find_by_id(id) return render('/location/view.mako')