Hi, I'm struggling with a piece of code to return a JSON and a single integer value to my template. I can only access the JSON and the second value doesn't seem to get sent.
@app.route('/make_selection', methods=['GET', 'POST'])
def game():
i = request.args.get('i', type=int)
j = request.args.get('j', type=int)
global FIRST_SELECTED
global CLICK
CLICK= getGemAt(board, i, j)
if CLICK == None and not FIRST_SELECTED:
return json.dumps(board)
elif CLICK != None and not FIRST_SELECTED:
FIRST_SELECTED = CLICK
CLICK = None
return json.dumps(board), FIRST_SELECTED
elif CLICK != None and FIRST_SELECTED != None:
return json.dumps(board)
So I'm trying to return the JSON of the board and then the value of the FIRST_SELECTED