def getShow(alias): from helix.database.show import Show with Manager(willCommit=False) as mgr: query = """SELECT * FROM {} WHERE alias='{}'""".format(Show.TABLE, alias) row = mgr.connection().execute(query).fetchone() if row and row[0]: return Show.dummy().unmap(row) return None
def getShows(): from helix.database.show import Show with Manager(willCommit=False) as mgr: query = """SELECT * FROM {}""".format(Show.TABLE) rows = mgr.connection().execute(query).fetchall() shows = [] for r in rows: shows.append(Show.dummy().unmap(r)) return shows