'Get info about database statistics.
Returns:
census (dict): A dictionary `{typeclass_path: number, ...}` with
all the typeclasses active in-game as well as the number
of such objects defined (i.e. the number of database
object having that typeclass set on themselves).'

def object_totals(self):

    dbtotals = {}
    typeclass_paths = set(self.values_list('db_typeclass_path', flat=True))
    for typeclass_path in typeclass_paths:
        dbtotals[typeclass_path] = self.filter(db_typeclass_path=typeclass_path).count()
    return dbtotals
