Ejemplo n.º 1
0
def get_round(rid, game):
    d.execute("SELECT * FROM round WHERE round={} AND game={}".format(
        rid, game))
    rs = d.fetchone()
    if rs is None:
        return new_round(rid, game)
    return rs
Ejemplo n.º 2
0
def get_game(game_id):
    d.execute("SELECT * FROM game WHERE code='{}'".format(game_id))
    return d.fetchone()
Ejemplo n.º 3
0
def get_question(qid):
    d.execute("SELECT * FROM prompt WHERE id={}".format(qid))
    return d.fetchone()
Ejemplo n.º 4
0
def get_round_id(rid):
    d.execute("SELECT * FROM round WHERE id={}".format(rid))
    return d.fetchone()
Ejemplo n.º 5
0
def is_alien(pid):
    d.execute("SELECT alien FROM player WHERE id={}".format(pid))
    return d.fetchone()["alien"] == 1
Ejemplo n.º 6
0
def get_player_info(player_id):
    d.execute("SELECT * FROM player WHERE id={}".format(player_id))
    return d.fetchone()
Ejemplo n.º 7
0
def get_game_info(player_id):
    d.execute(
        "select * from game where id=(select game from player where id={})".
        format(player_id))
    return d.fetchone()