当前位置: 首页>>代码示例>>Python>>正文


Python helpers.flash函数代码示例

本文整理汇总了Python中zkpylons.lib.helpers.flash函数的典型用法代码示例。如果您正苦于以下问题:Python flash函数的具体用法?Python flash怎么用?Python flash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了flash函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _delete

    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')
开发者ID:PaulWay,项目名称:zookeepr,代码行数:7,代码来源:funding_type.py

示例2: _review

    def _review(self, id):
        """Review a funding application.
        """
        c.funding = Funding.find_by_id(id)
        c.signed_in_person = h.signed_in_person()
        c.next_review_id = Funding.find_next_proposal(c.funding.id, c.funding.type.id, c.signed_in_person.id)

        person = c.signed_in_person
        if person in [ review.reviewer for review in c.funding.reviews]:
            h.flash('Already reviewed')
            return redirect_to(action='review', id=c.next_review_id)

        results = self.form_result['review']
        if results['score'] == 'null':
          results['score'] = None

        review = FundingReview(**results)

        meta.Session.add(review)
        c.funding.reviews.append(review)

        review.reviewer = person

        meta.Session.commit()
        if c.next_review_id:
            return redirect_to(action='review', id=c.next_review_id)

        h.flash("No more funding applications to review")

        return redirect_to(action='review_index')
开发者ID:Ivoz,项目名称:zookeepr,代码行数:30,代码来源:funding.py

示例3: _delete

    def _delete(self, id):
        c.travel = Travel.find_by_id(id)
        meta.Session.delete(c.travel)
        meta.Session.commit()

        h.flash("Travel has been deleted.")
        redirect_to("index")
开发者ID:gracz120,项目名称:zookeepr,代码行数:7,代码来源:travel.py

示例4: _delete

    def _delete(self, id):
        c.event = Event.find_by_id(id)
        meta.Session.delete(c.event)
        meta.Session.commit()

        h.flash("Event has been deleted.")
        redirect_to('index')
开发者ID:SharifulAlamSourav,项目名称:zookeepr,代码行数:7,代码来源:event.py

示例5: _delete

    def _delete(self, id):
        c.fulfilment_status = FulfilmentStatus.find_by_id(id)
        meta.Session.delete(c.fulfilment_status)
        meta.Session.commit()

        h.flash("Fulfilment Status has been deleted.")
        redirect_to('index', id=None)
开发者ID:flosokaks,项目名称:zookeepr,代码行数:7,代码来源:fulfilment_status.py

示例6: _edit

    def _edit(self, id):
        # We need to recheck auth in here so we can pass in the id
        if not h.auth.authorized(h.auth.Or(h.auth.is_same_zkpylons_submitter(id), h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()

        if not h.auth.authorized(h.auth.has_organiser_role):
            if c.paper_editing == 'closed' and not h.auth.authorized(h.auth.has_late_submitter_role):
                return render("proposal/editing_closed.mako")
            elif c.paper_editing == 'not_open':
                return render("proposal/editing_not_open.mako")

        c.proposal = Proposal.find_by_id(id)
        for key in self.form_result['proposal']:
            setattr(c.proposal, key, self.form_result['proposal'][key])

        c.proposal.abstract = self.clean_abstract(c.proposal.abstract)

        c.person = self.form_result['person_to_edit']
        if (c.person.id == h.signed_in_person().id or
                             h.auth.authorized(h.auth.has_organiser_role)):
            for key in self.form_result['person']:
                setattr(c.person, key, self.form_result['person'][key])
            p_edit = "and author"
        else:
            p_edit = "(but not author)"

        meta.Session.commit()

        if lca_info['proposal_update_email'] != '':
            body = "Subject: %s Proposal Updated\n\nID:    %d\nTitle: %s\nType:  %s\nURL:   %s" % (h.lca_info['event_name'], c.proposal.id, c.proposal.title, c.proposal.type.name.lower(), "http://" + h.host_name() + h.url_for(action="view"))
            email(lca_info['proposal_update_email'], body)

        h.flash("Proposal %s edited!"%p_edit)
        return redirect_to('/proposal')
开发者ID:PaulWay,项目名称:zookeepr,代码行数:35,代码来源:proposal.py

示例7: _delete

    def _delete(self, id):
        c.location = Location.find_by_id(id)
        meta.Session.delete(c.location)
        meta.Session.commit()

        h.flash("Location has been deleted.")
        redirect_to('index')
开发者ID:SharifulAlamSourav,项目名称:zookeepr,代码行数:7,代码来源:location.py

示例8: _delete

    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")
开发者ID:gracz120,项目名称:zookeepr,代码行数:7,代码来源:proposal_type.py

示例9: _delete

    def _delete(self, id):
        c.stream = Stream.find_by_id(id)
        meta.Session.delete(c.stream)
        meta.Session.commit()

        h.flash("Stream has been deleted.")
        redirect_to('index')
开发者ID:SharifulAlamSourav,项目名称:zookeepr,代码行数:7,代码来源:stream.py

示例10: _delete

    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')
开发者ID:SharifulAlamSourav,项目名称:zookeepr,代码行数:7,代码来源:social_network.py

示例11: _delete

    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')
开发者ID:SharifulAlamSourav,项目名称:zookeepr,代码行数:7,代码来源:proposal_status.py

示例12: delete_folder

    def delete_folder(self):
        try:
            if request.GET['folder'] is not None:
                c.folder += request.GET['folder']
                c.current_folder += request.GET['current_path']
        except KeyError:
           abort(404)

        directory = file_paths['public_path']
        defaults = dict(request.POST)
        if defaults:
            c.no_theme = 'false'
            if request.GET.has_key('no_theme'):
                if request.GET['no_theme'] == 'true':
                    c.no_theme = 'true'
            try:
                os.rmdir(directory + c.folder)
            except OSError:
                h.flash("Can not delete. The folder contains items.", 'error')
                redirect_to(action="list_files", folder=c.current_folder, no_theme = c.no_theme)
            h.flash("Folder deleted.")
            redirect_to(action="list_files", folder=c.current_folder, no_theme = c.no_theme)
        c.no_theme = False
        if request.GET.has_key('no_theme'):
            if request.GET['no_theme'] == 'true':
                c.no_theme = True
        return render('/db_content/delete_folder.mako')
开发者ID:flosokaks,项目名称:zookeepr,代码行数:27,代码来源:db_content.py

示例13: _delete

    def _delete(self, id):
        c.db_content = DbContent.find_by_id(id)
        meta.Session.delete(c.db_content)
        meta.Session.commit()

        h.flash("Content Deleted.")
        redirect_to('index')
开发者ID:flosokaks,项目名称:zookeepr,代码行数:7,代码来源:db_content.py

示例14: _delete

    def _delete(self, id):
        c.fulfilment = Fulfilment.find_by_id(id)
        meta.Session.delete(c.fulfilment)
        meta.Session.commit()

        h.flash("Fulfilment has been deleted.")
        redirect_to("index", id=None)
开发者ID:n6151h,项目名称:pyconau2016,代码行数:7,代码来源:fulfilment.py

示例15: unvoid

 def unvoid(self, id):
     c.invoice = Invoice.find_by_id(id, True)
     c.invoice.void = None
     c.invoice.manual = True
     meta.Session.commit()
     h.flash("Invoice was un-voided.")
     return redirect_to(action='view', id=c.invoice.id)
开发者ID:n6151h,项目名称:pyconau2016,代码行数:7,代码来源:invoice.py


注:本文中的zkpylons.lib.helpers.flash函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。