コード例 #1
0
ファイル: funding_type.py プロジェクト: PaulWay/zookeepr
    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)
コード例 #2
0
ファイル: funding_type.py プロジェクト: PaulWay/zookeepr
    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')
コード例 #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)
コード例 #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')
コード例 #5
0
ファイル: funding.py プロジェクト: noisymime/zookeepr
 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',
     }
コード例 #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',
     }
コード例 #7
0
ファイル: funding_type.py プロジェクト: PaulWay/zookeepr
    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')
コード例 #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')
コード例 #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)
コード例 #10
0
ファイル: funding_type.py プロジェクト: PaulWay/zookeepr
    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)
コード例 #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)
コード例 #12
0
ファイル: validators.py プロジェクト: noisymime/zookeepr
 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
コード例 #13
0
 def view(self, id):
     c.funding_type = FundingType.find_by_id(id)
     return render('/funding_type/view.mako')
コード例 #14
0
ファイル: funding_type.py プロジェクト: PaulWay/zookeepr
 def view(self, id):
     c.funding_type = FundingType.find_by_id(id)
     return render('/funding_type/view.mako')
コード例 #15
0
 def index(self):
     c.funding_type_collection = FundingType.find_all()
     return render('/funding_type/list.mako')
コード例 #16
0
ファイル: validators.py プロジェクト: flosokaks/zookeepr
 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
コード例 #17
0
ファイル: funding_type.py プロジェクト: PaulWay/zookeepr
 def index(self):
     c.funding_type_collection = FundingType.find_all()
     return render('/funding_type/list.mako')