def get_score(self, obj):
        query = """
        SELECT SUM(vote), COUNT(vote)
        FROM %s
        WHERE content_type_id = %%s
          AND object_id = %%s""" % qn(self.model._meta.db_table)
        ctype = ContentType.objects.get_for_model(obj)
        cursor = connection.cursor()
        cursor.execute(query, [ctype.id, obj._get_pk_val()])
        result = cursor.fetchall()[0]
        # MySQL returns floats and longs respectively for these
        # results, so we need to convert them to ints explicitly.
        return {
            'score': result[0] and int(result[0]) or 0,
            'num_votes': int(result[1]),
        }
Get a dictionary containing the total score for ``obj`` and
dataset/ETHPy150Open davemerwin/blue-channel/external_apps/voting/managers.py/VoteManager.get_score