def get_all(): rows = db.db_fetch_all(gametime.DATABASE_FILENAME, "SELECT * FROM MyGame") return [db.get_generic(MyGame(), row, False) for row in rows]
def get(id): row = db.db_fetch_one(gametime.DATABASE_FILENAME, "SELECT * FROM MyGame WHERE id = ?", [id]) return db.get_generic(MyGame(), row, False) if row else None