Forums

Incomplete list being returned

this is my code (solutions is a list of dictionaries):

solution = recursiveBacktracking({}, user)

print(solution)

return jsonify({'schedules': solution})

this is what i can see in the server log file, which indicates that the list is being cut off towards the end

2024-05-12 09:19:03 [{'1:00': '', '2:00': '', '3:00': '', '4:00': '', '5:00': '', '6:00': '', '7:00': '', '8:00': 'breakfast', '9:00': 'run', '10:00': '', '11:00': '', '12:00': '', '13:00': '', '14:00': '', '15:00': '', '16:00': '', '17:00': '', '18:00': '', '19:00': '', '20:00': '', '21:00': '', '22:00': '', '23:00': '', '24:00': ''}, {}, {'1:00': '', '2:00': '', '3:00': '', '4:00': '', '5:00': '', '6:00': '', '7:00': '', '8:00': '', '9:00': 'run', '10:00': 'breakfast', '11:00': '', '12:00': '', '13:00': '', '14:00': '', '15:00': '', '16:00': '', '17:00': '', '18:00': '', '19:00': '', '20:00': '', '21:00': '', '22:00': '', '23:00': '', '24:00': ''}, {'1:00': '', '2:00': '', '3:00': '', '4:00': '', '5:00': '', '6:00': '', '7:00': '', '8:00': '', '9:00': 'run', '10:00': '', '11:00': 'breakfast', '12:00': '', '13:00': '', '14:00': '', '15:00': '', '16:00': '', '17:00': '', '18:00': '', '19:00': '', '20:00': '', '21:00': '', '22:00': '', '23:00': '', '2

another problem is that while trying to access the list in my flutter app the keys of each dictionary are changed in order.

Try and add a flush=True to your print statement