def campaign_history(cls, codenames, start, stop):
 time_points = get_time_points('hour', start, stop)
 q = Session.query(cls).filter((cls.interval == 'hour')).filter(cls.codename.in_(codenames)).filter(cls.date.in_(time_points)).order_by(cls.date)
 return [(r.date, r.codename, r.subreddit, (r.unique_count, r.pageview_count)) for r in q.all()]

def campaign_history ( cls , codenames , start , stop ) : time_points = get_time_points ( 'hour' , start , stop ) q = Session . query ( cls ) . filter ( ( cls . interval == 'hour' ) ) . filter ( cls . codename . in_ ( codenames ) ) . filter ( cls . date . in_ ( time_points ) ) . order_by ( cls . date ) return [ ( r . date , r . codename , r . subreddit , ( r . unique_count , r . pageview_count ) ) for r in q . all ( ) ]
get hourly traffic for given campaigns .