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