本文整理汇总了Python中models.insight.Insight.get_by_id_async方法的典型用法代码示例。如果您正苦于以下问题:Python Insight.get_by_id_async方法的具体用法?Python Insight.get_by_id_async怎么用?Python Insight.get_by_id_async使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.insight.Insight
的用法示例。
在下文中一共展示了Insight.get_by_id_async方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _render
# 需要导入模块: from models.insight import Insight [as 别名]
# 或者: from models.insight.Insight import get_by_id_async [as 别名]
def _render(self):
template_values = {
'valid_years': VALID_YEARS,
}
insight_futures = [Insight.get_by_id_async(Insight.renderKeyName(0, insight_name)) for insight_name in Insight.INSIGHT_NAMES.values()]
for insight_future in insight_futures:
insight = insight_future.get_result()
if insight:
template_values[insight.name] = insight
path = os.path.join(os.path.dirname(__file__), '../templates/insights.html')
return template.render(path, template_values)