def get_count(cls, name):
cache_key = CrashReport.count_cache_key(name)
total = memcache.get(cache_key)
if total is None:
total = 0
q = CrashReport.all()
q.filter('name = ', name)
for entity in q.run():
total += entity.count
memcache.set(cache_key, str(total))
return int(total)
评论列表
文章目录