def get_list(self): conn = hub.getConnection() top_venues = conn.queryAll(""" select v.name, v.id, COUNT(uav.user_acct_id) as count from venue v, user_acct_venue uav where v.id = uav.venue_id group by v.name, v.id order by count desc, name limit 10 """) return [dict(name=a.decode('utf8'), id=b, count=c) for a, b, c in top_venues]
def get_list(self): conn = hub.getConnection() top_artists = conn.queryAll(""" select a.name, a.id, COUNT(aua.user_acct_id) as count from artist a, artist_user_acct aua where a.id = aua.artist_id group by a.name, a.id order by count desc, name limit 10 """) return [dict(name=a.decode('utf8'), id=b, count=c) for a, b, c in top_artists]