Ejemplo n.º 1
0
def matches():
    user = User()
    user_matches = user.matched(json.loads(session['log'])['id'])
    user_likes = user.likes(json.loads(session['log'])['id'])
    my_likes = user.my_likes(json.loads(session['log'])['id'])
    arr_match = np.array(user_matches)
    if len(arr_match) > 0:
        user_likes = [likes for likes in user_likes if str(likes[2]) not in arr_match[:, 2]]
        my_likes = [likes for likes in my_likes if str(likes[2]) not in arr_match[:, 2]]
    vis = Visit(json.loads(session['log'])['id'])
    visits = vis.get_all()
    return render_template('matches.html', matches=user_matches, likes=user_likes, my_likes=my_likes, visits=visits)
Ejemplo n.º 2
0
def chat():
    user = User()
    user_matches = user.matched(json.loads(session['log'])['id'])
    return render_template('chat.html', matches=user_matches)