def get(self): templatevars = {"title":"PREOMR - sites"} sites = [ (s,get_count("Work-%s"%s.name)) for s in Site.all().fetch(100)] templatevars['sites'] = sites total = sum( [ s[1] for s in sites ] ) templatevars["totalhere"] = total templatevars["overalltotal"] = get_count("Work") self.generate("sites.html",templatevars)