blob: 4348248d3656cc113d76043d162939fdb4c34f6a (
plain)
1
2
3
4
5
6
7
8
9
10
|
from config import render, db
class Repo(object):
def GET(self):
repo_count = db.query('select REPO,COUNT(DISTINCT IPKEY) AS PACKAGES,COUNT(DISTINCT UUID) AS HOSTS from INSTALLED_PACKAGES natural join REPOSITORIES group by REPO')
repo_data = dict()
for t in repo_count:
repo_data[t['REPO']] = {'HOSTS':t['HOSTS'], 'PACKAGES':t['PACKAGES']}
return render.repo(repo_data)
|