• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python helpers.flash函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: _delete

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

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


示例17: _new

    def _new(self):
        person_results = self.form_result['person']
        proposal_results = self.form_result['proposal']
        attachment_results = self.form_result['attachment']

        proposal_results['status'] = ProposalStatus.find_by_name('Pending')

        c.proposal = Proposal(**proposal_results)
        meta.Session.add(c.proposal)

        if not h.signed_in_person():
            c.person = model.Person(**person_results)
            meta.Session.add(c.person)
            email(c.person.email_address, render('/person/new_person_email.mako'))
        else:
            c.person = h.signed_in_person()
            for key in person_results:
                setattr(c.person, key, self.form_result['person'][key])

        c.person.proposals.append(c.proposal)

        if attachment_results is not None:
            c.attachment = Attachment(**attachment_results)
            c.proposal.attachments.append(c.attachment)
            meta.Session.add(c.attachment)

        meta.Session.commit()
        email(c.person.email_address, render('proposal/thankyou_mini_email.mako'))

        h.flash("Proposal submitted!")
        return redirect_to(controller='proposal', action="index", id=None)
开发者ID:Secko,项目名称:zookeepr,代码行数:31,代码来源:miniconf_proposal.py


示例18: _delete

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

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


示例19: _delete

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

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


示例20: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # WSGIController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        person = h.signed_in_person()
        if person and not person.activated:
            msg = ("Your account (%s) hasn't been confirmed. Check your email"
                   " for activation instructions. %s" %
                   (person.email_address, 'link-to-reset'))
            h.flash(msg, category="warning")

        # Moved here from index controller so that all views that import the news.mako template
        # have access to c.db_content_news and c.db_content_press
        news = DbContentType.find_by_name("News", abort_404 = False)
        if news:
            c.db_content_news = meta.Session.query(DbContent).filter_by(type_id=news.id).filter(DbContent.publish_timestamp <= datetime.datetime.now()).order_by(DbContent.creation_timestamp.desc()).limit(4).all()
            c.db_content_news_all = meta.Session.query(DbContent).filter_by(type_id=news.id).filter(DbContent.publish_timestamp <= datetime.datetime.now()).order_by(DbContent.creation_timestamp.desc()).all() #use all to find featured items

        press = DbContentType.find_by_name("In the press", abort_404 = False)
        if press:
            c.db_content_press = meta.Session.query(DbContent).filter_by(type_id=press.id).order_by(DbContent.creation_timestamp.desc()).filter(DbContent.publish_timestamp <= datetime.datetime.now()).limit(4).all()


        try:
            return WSGIController.__call__(self, environ, start_response)
        finally:
            meta.Session.remove()
开发者ID:wcmckee,项目名称:zookeepr,代码行数:29,代码来源:base.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python helpers.object_to_defaults函数代码示例发布时间:2022-05-26
下一篇:
Python base.render函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap