Beispiel #1
0
def user_profile(request):
    user_profile = request.user.get_profile()

    users_id = []
    users_id.append(request.user.id)

    timelines = timeline.timeline(users_id)
    token = Token.objects.get(user=request.user)

    ret = {'user_profile': user_profile, 'token': token.key}
    return render(request, 'social/user-profile.html', ret)
Beispiel #2
0
def user_profile(request):
    user_profile = request.user.get_profile()
    
    users_id = []
    users_id.append(request.user.id)
    
    timelines = timeline.timeline(users_id)
    
    variables = RequestContext(request, {
        'user_profile': user_profile,
        'timeline': timelines
    })
    return render_to_response('user-profile.html', variables)
Beispiel #3
0
def user_profile(request):
    user_profile = request.user.get_profile()
    
    users_id = []
    users_id.append(request.user.id)
    
    timelines = timeline.timeline(users_id)
    token = Token.objects.get(user=request.user)
    
    ret = {
        'user_profile': user_profile,
        'token': token.key
    }
    return render(request, 'social/user-profile.html', ret)
Beispiel #4
0
def timeline_page(request):
    follower = request.user
    users_followed = UserFollowsUser.objects.filter(
        user_follower=follower).values('user_followed_id')
    users_id = []
    users_id.append(request.user.id)

    for user in users_followed:
        users_id.append(user['user_followed_id'])

    timelines = timeline.timeline(users_id)

    ret = {'timeline': timelines}
    return render(request, 'social/timeline-page.html', ret)
Beispiel #5
0
def timeline_page(request):
    follower = request.user
    users_followed = UserFollowsUser.objects.filter(user_follower=follower).values('user_followed_id')
    users_id = []
    users_id.append(request.user.id)
    
    for user in users_followed:
        users_id.append(user['user_followed_id'])
    
    timelines = timeline.timeline(users_id)
    
    ret = {
        'timeline': timelines
    }
    return render(request, 'social/timeline-page.html', ret)
Beispiel #6
0
def timeline_page(request):
    
    follower = request.user
    users_followed = UserFollowsUser.objects.filter(user_follower=follower).values('user_followed_id')
    users_id = []
    users_id.append(request.user.id)
    
    for user in users_followed:
        users_id.append(user['user_followed_id'])
    
    
    timelines = timeline.timeline(users_id)
    
    variables = RequestContext(request, {
        'timeline': timelines
    })
    return render_to_response('timeline-page.html', variables)
Beispiel #7
0
def user_page(request, username):
    other_user = get_object_or_404(User, username=username)
    profile = get_object_or_404(UserProfile, user_id=other_user.id)
    
    user = request.user
    if len(UserFollowsUser.objects.filter(user_follower_id=user, user_followed_id=other_user)) == 0:
        follow = False
    else:
        follow = True
    
    users_id = []
    users_id.append(other_user.id)
    timelines = timeline.timeline(users_id)
    
    ret = {"other_user": other_user,
           "profile": profile,
           "timeline": timelines,
           "follow": follow
    }

    return render(request, "social/user_page.html", ret)
Beispiel #8
0
def user_page(request, username):
    other_user = get_object_or_404(User, username=username)
    profile = get_object_or_404(UserProfile, user_id=other_user.id)

    user = request.user
    if len(
            UserFollowsUser.objects.filter(user_follower_id=user,
                                           user_followed_id=other_user)) == 0:
        follow = False
    else:
        follow = True

    users_id = []
    users_id.append(other_user.id)
    timelines = timeline.timeline(users_id)

    ret = {
        "other_user": other_user,
        "profile": profile,
        "timeline": timelines,
        "follow": follow
    }

    return render(request, "social/user_page.html", ret)