Ejemplo n.º 1
0
def get_chart_data():
    data         = request.json['data']
    rollup       = Rollup( PersistenceManager(myapp.db_connector),
                           data['value'],
                           data['eliminationOnly'],
                           data['storeChampionshipsOnly'],
                           data['regionalChampionshipsOnly'])
    chart_data   = rollup.rollup()
    return jsonify(data=chart_data,
                   title=data['value'] + rollup.title(),
                   firstCategory=rollup.first_category(),
                   secondCategory=rollup.second_category())
Ejemplo n.º 2
0
    def testRollup(self):

        r = Rollup(self.pm, 'faction-ship-points', True)
        data = r.rollup()
        self.assertTrue(data is not None)
        self.assertEqual(len(data), 2)

        rebs = data[0]
        self.assertEqual(rebs['drilldown']['name'], 'Imperial')

        r = Rollup(self.pm, 'ship-pilot-points', True)
        data = r.rollup()
        self.assertTrue(data is not None)
        self.assertEqual(len(data), 11)
        sum = 0
        for rd in data:
            sum += rd['y']
        self.assertAlmostEqual(100.0, sum, 1)

        r = Rollup(self.pm, 'upgrade_type-upgrade-points', True)
        data = r.rollup()
        self.assertTrue(data is not None)
        self.assertEqual(len(data), 8)
Ejemplo n.º 3
0
    def testRollup(self):

        r = Rollup(self.pm, "faction-ship-points", True)
        data = r.rollup()
        self.assertTrue(data is not None)
        self.assertEqual(len(data), 2)

        rebs = data[0]
        self.assertEqual(rebs["drilldown"]["name"], "Imperial")

        r = Rollup(self.pm, "ship-pilot-points", True)
        data = r.rollup()
        self.assertTrue(data is not None)
        self.assertEqual(len(data), 11)
        sum = 0
        for rd in data:
            sum += rd["y"]
        self.assertAlmostEqual(100.0, sum, 1)

        r = Rollup(self.pm, "upgrade_type-upgrade-points", True)
        data = r.rollup()
        self.assertTrue(data is not None)
        self.assertEqual(len(data), 8)