本文整理汇总了Python中zookeepr.lib.helpers.flash函数的典型用法代码示例。如果您正苦于以下问题:Python flash函数的具体用法?Python flash怎么用?Python flash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了flash函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _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')
示例2: _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')
示例3: _delete
def _delete(self, id):
c.product_category = ProductCategory.find_by_id(id)
meta.Session.delete(c.product_category)
meta.Session.commit()
h.flash("Category has been deleted.")
redirect_to('index')
示例4: _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')
示例5: 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')
示例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_zookeepr_funding_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.funding_editing == 'closed':
return render("funding/editing_closed.mako")
elif c.funding_editing == 'not_open':
return render("funding/editing_not_open.mako")
if self.form_result['funding']['male'] == 1:
self.form_result['funding']['male'] = True
elif self.form_result['funding']['male'] == 0:
self.form_result['funding']['male'] = False
c.funding = Funding.find_by_id(id)
for key in self.form_result['funding']:
setattr(c.funding, key, self.form_result['funding'][key])
c.person = c.funding.person
meta.Session.commit()
h.flash("Funding for %s edited!"%c.person.firstname)
return redirect_to('/funding')
示例7: pending
def pending(self, id):
volunteer = Volunteer.find_by_id(id)
volunteer.accepted = None
volunteer.ticket_type = None
meta.Session.commit()
h.flash("Status Updated")
redirect_to(action="index", id=None)
示例8: _delete
def _delete(self, id):
c.schedule = Schedule.find_by_id(id)
meta.Session.delete(c.schedule)
meta.Session.commit()
h.flash("Schedule has been deleted.")
redirect_to('index')
示例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')
示例10: _new
def _new(self):
results = self.form_result['invoice']
del(results['item_count'])
items = results['items']
results['items'] = []
c.invoice = Invoice(**results)
for i in items:
item = InvoiceItem()
if i['description'] != "":
item.description = i['description']
else:
product = Product.find_by_id(i['product'].id)
category = product.category
item.product = i['product']
item.description = product.category.name + ' - ' + product.description
item.cost = i['cost']
item.qty = i['qty']
c.invoice.items.append(item)
c.invoice.manual = True
c.invoice.void = None
meta.Session.add(c.invoice)
meta.Session.commit()
h.flash("Manual invoice created")
return redirect_to(action='view', id=c.invoice.id)
示例11: 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)
示例12: _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')
示例13: _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_zookeepr_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')
示例14: _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")
示例15: _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")