diff options
author | Aleksey Lim <alsroot@sugarlabs.org> | 2014-05-12 15:12:24 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@sugarlabs.org> | 2014-05-12 15:50:02 (GMT) |
commit | e0008f8b1cd2ccb1e044dfbabfa30c54d07d71fa (patch) | |
tree | 4208645b16b277cb55872ea85a5aa7ec479d1291 /sugar_network/node/model.py | |
parent | fbfc90eae2909a640dfee17715f39234522ea3bf (diff) |
Revert node statistics
Diffstat (limited to 'sugar_network/node/model.py')
-rw-r--r-- | sugar_network/node/model.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/sugar_network/node/model.py b/sugar_network/node/model.py index 87abed6..48fa5a3 100644 --- a/sugar_network/node/model.py +++ b/sugar_network/node/model.py @@ -616,28 +616,6 @@ def load_bundle(blob, context=None, initial=False, extra_deps=None, return context, release -def generate_node_stats(volume): - - def calc_rating(**kwargs): - rating = [0, 0] - alldocs, __ = volume['post'].find(**kwargs) - for post in alldocs: - if post['vote']: - rating[0] += 1 - rating[1] += post['vote'] - return rating - - alldocs, __ = volume['context'].find() - for context in alldocs: - rating = calc_rating(type='review', context=context.guid) - volume['context'].update(context.guid, {'rating': rating}) - - alldocs, __ = volume['post'].find(topic='') - for topic in alldocs: - rating = calc_rating(type='feedback', topic=topic.guid) - volume['post'].update(topic.guid, {'rating': rating}) - - def _load_context_metadata(bundle, spec): result = {} for prop in ('homepage', 'mime_types'): |