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