本文整理汇总了Python中GlobalUtilities.giveError方法的典型用法代码示例。如果您正苦于以下问题:Python GlobalUtilities.giveError方法的具体用法?Python GlobalUtilities.giveError怎么用?Python GlobalUtilities.giveError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlobalUtilities
的用法示例。
在下文中一共展示了GlobalUtilities.giveError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: task
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import giveError [as 别名]
def task(self, isAdmin, s):
donation_key = self.request.get("id")
if donation_key == "":
# If they didn't type any arguments into the address bar - meaning it didn't come from the app
tools.giveError(self, 500)
else:
# Getting donation by its key (from address bar argument)
d = tools.getKey(donation_key).get()
c = d.contact.get()
i_key = tools.getUserKey(self)
i = i_key.get()
donation_date = [d.donation_date.day, d.donation_date.month, d.donation_date.year]
donation_date = json.dumps(donation_date)
template_variables = {"d": d, "c": c, "s": s, "i": i, "donation_date": donation_date}
self.response.write(
template.render('pages/rq_details.html', template_variables))
示例2: get
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import giveError [as 别名]
def get(self, address):
logging.info("404 error on address: " + str(address))
tools.giveError(self, 404)