/soc/2012/sanket/www-statscollector: 20c34e3dc9de: Add ``drilldo...
sanket
sanket at soc.pidgin.im
Tue Jul 10 01:30:20 EDT 2012
Changeset: 20c34e3dc9de5582fb75d4db95b57831b29eb2d7
Author: sanket <sanket at soc.pidgin.im>
Date: 2012-07-09 22:29 +0530
Branch: default
URL: http://hg.pidgin.im/soc/2012/sanket/www-statscollector/rev/20c34e3dc9de
Description:
Add ``drilldown'' on prpl-protocols
prpl-protocols can be classified on which sub-service they are
working on. Eg: prpl-irc can be based on vairous servers.
Similarly prpl-jabber might be working on various connect-servers etc.
diffstat:
pidgin_stats_collector/display/views.py | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diffs (23 lines):
diff --git a/pidgin_stats_collector/display/views.py b/pidgin_stats_collector/display/views.py
--- a/pidgin_stats_collector/display/views.py
+++ b/pidgin_stats_collector/display/views.py
@@ -186,6 +186,19 @@
stats_prpl_p['prpl-jabber']['drilldown']['categories'].append(item['service'])
stats_prpl_p['prpl-jabber']['drilldown']['data'].append(item['service__count'])
+ if 'prpl-irc' not in stats_prpl_p: stats_prpl_p['prpl-irc'] = {}
+ stats_prpl_p['prpl-irc']['drilldown'] = {}
+ stats_prpl_p['prpl-irc']['drilldown']['name'] = 'IRC servers'
+ stats_prpl_p['prpl-irc']['drilldown']['categories'] = []
+ stats_prpl_p['prpl-irc']['drilldown']['data'] = []
+
+ irc_service_dict = Account.objects.filter(prpl_name='prpl-irc').\
+ values('service').annotate(Count('service')).order_by('-service__count')
+
+ for item in irc_service_dict:
+ stats_prpl_p['prpl-irc']['drilldown']['categories'].append(item['service'])
+ stats_prpl_p['prpl-irc']['drilldown']['data'].append(item['service__count'])
+
# Plugins (3rd party/loadable-unloadable)
plugin_count_dict = Plugin.objects.values('p_id').\
annotate(Count('p_id')).order_by('-p_id__count')
More information about the Commits
mailing list