Beispiel #1
0
def follow(user):
    """ Controller for following a user """
    try:
        User.objects(username=session['username']).update_one(add_to_set__following=user)
        return redirect('/u/%s' % user)
        
    except:
        return 'fail'
Beispiel #2
0
def subscribe(tag):
    """ Controller for subscribing to tags """
    try:
        User.objects(username=session['username']).update_one(add_to_set__subscriptions=tag)
        return redirect('/tags/%s' % tag)
        
    except:
        return 'fail'
def subscribe(tag):
    """ Controller for subscribing to tags """
    try:
        User.objects(username=session['username']).update_one(
            add_to_set__subscriptions=tag)
        return redirect('/tags/%s' % tag)

    except:
        return 'fail'
Beispiel #4
0
def follow(user):
    """ Controller for following a user """
    try:
        User.objects(username=session['username']).update_one(
            add_to_set__following=user)
        return redirect('/u/%s' % user)

    except:
        return 'fail'