Exemplo n.º 1
0
    def getBasicMetrics(self):
        numbers = mMetrics.getCounts(self.db)
        kwUsage = mMetrics.getKeywordUsage(self.db, 6, 0)
        kwNum = mMetrics.getNumKeywords(self.db)

        data = dict(overall = numbers,
                    tags = dict(num_total = kwNum,
                                top = kwUsage))
        return self.json(data)
Exemplo n.º 2
0
    def getTagsCSV(self):
        data = mMetrics.getKeywordUsage(self.db, 1000, 0)
        csv = []

        csv.append('"WORD","TOTAL","PROJECTS","RESOURCES"')

        for item in data:
            csv.append('"%s","%s","%s","%s"' % (item.word, str(item.num_projects + item.num_resources), item.num_projects, item.num_resources))

        return self.csv('\n'.join(csv), "change_by_us.tags.csv")