def total_by_codename(cls, codenames):
 codenames = tup(codenames)
 q = Session.query(cls.codename, sum(cls.pageview_count)).filter((cls.interval == 'hour')).filter(cls.codename.in_(codenames)).group_by(cls.codename)
 return list(q)

def total_by_codename ( cls , codenames ) : codenames = tup ( codenames ) q = Session . query ( cls . codename , sum ( cls . pageview_count ) ) . filter ( ( cls . interval == 'hour' ) ) . filter ( cls . codename . in_ ( codenames ) ) . group_by ( cls . codename ) return list ( q )
return total lifetime pageviews for given codename(s) .