blob: 88fc7996888d11b614e56172d34629237c407c00 (
plain)
1
2
3
4
5
6
7
8
9
10
|
from config import render, db
class Keyword(object):
def GET(self):
keyword_count = db.query('SELECT KEYWORD, COUNT(DISTINCT IPKEY) AS PACKAGES, COUNT(DISTINCT UUID) AS HOSTS FROM GLOBAL_KEYWORDS NATURAL JOIN KEYWORDS NATURAL JOIN INSTALLED_PACKAGES GROUP BY KEYWORD')
keyword_data = dict()
for t in keyword_count:
keyword_data[t['KEYWORD']] = {'HOSTS':t['HOSTS'],'PACKAGES':t['PACKAGES']}
return render.keyword(keyword_data)
|