Пример #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'
Пример #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'
Пример #3
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'
Пример #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'