summaryrefslogtreecommitdiffstats
path: root/omaha_server/omaha/api.py
diff options
context:
space:
mode:
authorAndrey Mekin <anmekin@gmail.com>2016-06-06 13:35:59 +0300
committerAndrey Mekin <anmekin@gmail.com>2016-06-06 13:35:59 +0300
commitdcdcd6e4fc16e48cd458718bdb282948af2257f3 (patch)
treee5bc3586c24be3e399713d57db48270bac278172 /omaha_server/omaha/api.py
parentd57b0b44675bd82faf4ae89af1c7c8effca0e2ca (diff)
parente28866cf556876a46198cf1bdb5793fa18856ef2 (diff)
downloadomaha-server-dcdcd6e4fc16e48cd458718bdb282948af2257f3.zip
omaha-server-dcdcd6e4fc16e48cd458718bdb282948af2257f3.tar.gz
omaha-server-dcdcd6e4fc16e48cd458718bdb282948af2257f3.tar.bz2
Merge pull request #183 from anmekin/feature/stat_uninstalls
Add display of uninstalls on the Statistics page
Diffstat (limited to 'omaha_server/omaha/api.py')
-rw-r--r--omaha_server/omaha/api.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/omaha_server/omaha/api.py b/omaha_server/omaha/api.py
index 9301e43..e0f36c4 100644
--- a/omaha_server/omaha/api.py
+++ b/omaha_server/omaha/api.py
@@ -192,12 +192,13 @@ class StatisticsMonthsDetailView(APIView):
diapasons = [((start.month if year == start.year else 1, end.month if year == end.year else 12), year)
for year in range(start.year, end.year+1)]
- win_data = dict(new=[], updates=[])
+ win_data = dict(new=[], updates=[], uninstalls=[])
mac_data = dict(new=[], updates=[])
for diapason in diapasons:
step = get_users_statistics_months(app_id=app.id, platform='win', year=diapason[1], start=diapason[0][0], end=diapason[0][1])
win_data['new'] += step['new']
win_data['updates'] += step['updates']
+ win_data['uninstalls'] += step['uninstalls']
step = get_users_statistics_months(app_id=app.id, platform='mac', year=diapason[1], start=diapason[0][0], end=diapason[0][1])
mac_data['new'] += step['new']
mac_data['updates'] += step['updates']