Ejemplo n.º 1
0
    def edit(self, id):
        c.proposal_type = ProposalType.find_by_id(id)

        defaults = h.object_to_defaults(c.proposal_type, "proposal_type")

        form = render("/proposal_type/edit.mako")
        return htmlfill.render(form, defaults)
Ejemplo n.º 2
0
    def edit(self, id):
        c.proposal_type = ProposalType.find_by_id(id)

        defaults = h.object_to_defaults(c.proposal_type, 'proposal_type')

        form = render('/proposal_type/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 3
0
    def _delete(self, id):
        c.proposal_type = ProposalType.find_by_id(id)
        meta.Session.delete(c.proposal_type)
        meta.Session.commit()

        h.flash("Proposal type has been deleted.")
        redirect_to('index')
Ejemplo n.º 4
0
    def _delete(self, id):
        c.proposal_type = ProposalType.find_by_id(id)
        meta.Session.delete(c.proposal_type)
        meta.Session.commit()

        h.flash("Proposal type has been deleted.")
        redirect_to("index")
Ejemplo n.º 5
0
    def delete(self, id):
        """Delete the proposal type

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.proposal_type = ProposalType.find_by_id(id)
        return render('/proposal_type/confirm_delete.mako')
Ejemplo n.º 6
0
    def delete(self, id):
        """Delete the proposal type

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.proposal_type = ProposalType.find_by_id(id)
        return render("/proposal_type/confirm_delete.mako")
Ejemplo n.º 7
0
    def _edit(self, id):
        proposal_type = ProposalType.find_by_id(id)

        for key in self.form_result['proposal_type']:
            setattr(proposal_type, key, self.form_result['proposal_type'][key])

        # update the objects with the validated form data
        meta.Session.commit()
        h.flash("Proposal type has been updated successfully.")
        redirect_to(action='view', id=id)
Ejemplo n.º 8
0
    def _edit(self, id):
        proposal_type = ProposalType.find_by_id(id)

        for key in self.form_result["proposal_type"]:
            setattr(proposal_type, key, self.form_result["proposal_type"][key])

        # update the objects with the validated form data
        meta.Session.commit()
        h.flash("Proposal type has been updated successfully.")
        redirect_to(action="view", id=id)
Ejemplo n.º 9
0
 def _to_python(self, value, state):
     return ProposalType.find_by_id(value)
Ejemplo n.º 10
0
 def view(self, id):
     c.proposal_type = ProposalType.find_by_id(id)
     return render('/proposal_type/view.mako')
Ejemplo n.º 11
0
 def _to_python(self, value, state):
     return ProposalType.find_by_id(value)
Ejemplo n.º 12
0
 def view(self, id):
     c.proposal_type = ProposalType.find_by_id(id)
     return render("/proposal_type/view.mako")