... ukoly = dotaz.all() for ukol in ukoly: symbol = "[x]" if ukol.vyreseno else "[ ]" print(f"{symbol} {ukol.id}. {ukol.text}")