本文整理匯總了Python中canvas.cache_patterns.CachedCall.many_queryset_details方法的典型用法代碼示例。如果您正苦於以下問題:Python CachedCall.many_queryset_details方法的具體用法?Python CachedCall.many_queryset_details怎麽用?Python CachedCall.many_queryset_details使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類canvas.cache_patterns.CachedCall
的用法示例。
在下文中一共展示了CachedCall.many_queryset_details方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _profile
# 需要導入模塊: from canvas.cache_patterns import CachedCall [as 別名]
# 或者: from canvas.cache_patterns.CachedCall import many_queryset_details [as 別名]
def _profile(request, user, template='profiles/profile.html'):
comments = QuestComment.by_author(user)
top_comments = models.top_comments(user)
if top_comments is None:
comments = CachedCall.queryset_details(comments)
else:
comments, top_comments = CachedCall.many_queryset_details(comments, top_comments)
follow_counts = following_models.counts(user)
return r2r_jinja(template, {
'target_user': user,
'comments': comments,
'top_comments': top_comments,
'follower_count': follow_counts['followers'],
'following_count': follow_counts['following'],
}, request)