Exemplo n.º 1
0
    def edit(self, id):
        c.funding_type = FundingType.find_by_id(id)

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

        form = render('/funding_type/edit.mako')
        return htmlfill.render(form, defaults)
Exemplo n.º 2
0
    def _delete(self, id):
        c.funding_type = FundingType.find_by_id(id)
        meta.Session.delete(c.funding_type)
        meta.Session.commit()

        h.flash("Funding type has been deleted.")
        redirect_to('index')
Exemplo n.º 3
0
    def edit(self, id):
        c.funding_type = FundingType.find_by_id(id)

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

        form = render('/funding_type/edit.mako')
        return htmlfill.render(form, defaults)
Exemplo n.º 4
0
    def _delete(self, id):
        c.funding_type = FundingType.find_by_id(id)
        meta.Session.delete(c.funding_type)
        meta.Session.commit()

        h.flash("Funding type has been deleted.")
        redirect_to('index')
Exemplo n.º 5
0
 def __before__(self, **kwargs):
     c.funding_types = FundingType.find_all()
     c.form_fields = {
       'funding.why_attend': 'Why would you like to attend ' + h.lca_info['event_name'],
       'funding.how_contribute': 'How do you contribute to the Open Source community',
       'funding.financial_circumstances': 'What are your financial circumstances',
     }
Exemplo n.º 6
0
 def __before__(self, **kwargs):
     c.funding_types = FundingType.find_all()
     c.form_fields = {
       'funding.why_attend': 'Why would you like to attend ' + h.lca_info['event_name'],
       'funding.how_contribute': 'How do you contribute to the Open Source community',
       'funding.male': 'What is your gender',
       'funding.financial_circumstances': 'What are your financial circumstances',
     }
Exemplo n.º 7
0
    def delete(self, id):
        """Delete the funding type

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.funding_type = FundingType.find_by_id(id)
        return render('/funding_type/confirm_delete.mako')
Exemplo n.º 8
0
    def delete(self, id):
        """Delete the funding type

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.funding_type = FundingType.find_by_id(id)
        return render('/funding_type/confirm_delete.mako')
Exemplo n.º 9
0
    def _new(self):
        results = self.form_result['funding_type']

        c.funding_type = FundingType(**results)
        meta.Session.add(c.funding_type)
        meta.Session.commit()

        h.flash("Funding type created")
        redirect_to(action='view', id=c.funding_type.id)
Exemplo n.º 10
0
    def _edit(self, id):
        funding_type = FundingType.find_by_id(id)

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

        # update the objects with the validated form data
        meta.Session.commit()
        h.flash("Funding type has been updated successfully.")
        redirect_to(action='view', id=id)
Exemplo n.º 11
0
    def _edit(self, id):
        funding_type = FundingType.find_by_id(id)

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

        # update the objects with the validated form data
        meta.Session.commit()
        h.flash("Funding type has been updated successfully.")
        redirect_to(action='view', id=id)
Exemplo n.º 12
0
 def _to_python(self, value, state):
     funding_type = FundingType.find_by_id(int(value))
     if funding_type != None and funding_type.available():
         return funding_type
     else:
         return False
Exemplo n.º 13
0
 def view(self, id):
     c.funding_type = FundingType.find_by_id(id)
     return render('/funding_type/view.mako')
Exemplo n.º 14
0
 def view(self, id):
     c.funding_type = FundingType.find_by_id(id)
     return render('/funding_type/view.mako')
Exemplo n.º 15
0
 def index(self):
     c.funding_type_collection = FundingType.find_all()
     return render('/funding_type/list.mako')
Exemplo n.º 16
0
 def _to_python(self, value, state):
     funding_type = FundingType.find_by_id(int(value))
     if funding_type != None and funding_type.available():
       return funding_type
     else:
       return False
Exemplo n.º 17
0
 def index(self):
     c.funding_type_collection = FundingType.find_all()
     return render('/funding_type/list.mako')