本文整理汇总了Python中karl.views.api.TemplateAPI.set_error_message方法的典型用法代码示例。如果您正苦于以下问题:Python TemplateAPI.set_error_message方法的具体用法?Python TemplateAPI.set_error_message怎么用?Python TemplateAPI.set_error_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类karl.views.api.TemplateAPI
的用法示例。
在下文中一共展示了TemplateAPI.set_error_message方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from karl.views.api import TemplateAPI [as 别名]
# 或者: from karl.views.api.TemplateAPI import set_error_message [as 别名]
def __call__(self):
""" Folder contents for the INetworkEvents marker"""
context = self.context
request = self.request
page_title = context.title
api = TemplateAPI(context, request, page_title)
# Data for the filter bar, get the list of possible years and months
this_year = datetime.datetime.now().year
fb_years = [str(i) for i in range(2007, this_year + 1)]
fb_months = [
("1", "January"),
("2", "February"),
("3", "March"),
("4", "April"),
("5", "May"),
("6", "June"),
("7", "July"),
("8", "August"),
("9", "September"),
("10", "October"),
("11", "November"),
("12", "December"),
]
# Flatten the search results into ZPT data
try:
batch = self._get_batch()
except ParseError, e:
api.set_error_message("Error: %s" % e)
batch = {"entries": (), "batching_required": False}
示例2: __call__
# 需要导入模块: from karl.views.api import TemplateAPI [as 别名]
# 或者: from karl.views.api.TemplateAPI import set_error_message [as 别名]
def __call__(self):
""" Folder contents for the INetworkEvents marker"""
context = self.context
request = self.request
page_title = context.title
api = TemplateAPI(context, request, page_title)
# Data for the filter bar, get the list of possible years and months
this_year = datetime.datetime.now().year
fb_years = [str(i) for i in range(2007, this_year+1)]
fb_months = [('1', 'January'), ('2', 'February'), ('3', 'March'),
('4', 'April'), ('5', 'May'), ('6', 'June'),
('7', 'July'), ('8', 'August'), ('9', 'September'),
('10', 'October'), ('11', 'November'), ('12', 'December')]
# Flatten the search results into ZPT data
try:
batch = self._get_batch()
except ParseError, e:
api.set_error_message('Error: %s' % e)
batch = {'entries': (), 'batching_required': False}