def get_field_second(): """return field by opponent """ if request.method == 'POST': if request.cookies.has_key('session_id'): cookie_session = request.cookies.get('session_id') field_opponent = get_field_opponent(cookie_session) return jsonify(field_opponent=field_opponent)
def check_shot(): """check a shot and return result of shot """ if request.method == 'POST': if request.cookies.has_key('session_id'): cookie_session = request.cookies.get('session_id') update_user(**{ 'session_id': cookie_session, 'time': True }) coordinata = request.form['coordinata'].encode('utf8') result = get_value_coordinata(cookie_session, coordinata) field_opponent = get_field_opponent(cookie_session) return jsonify(result=result, coordinata=coordinata, field_opponent=field_opponent)