Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar_network/node/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'sugar_network/node/model.py')
-rw-r--r--sugar_network/node/model.py22
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'):