コード例 #1
0
ファイル: views.py プロジェクト: darad/dunya
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)
コード例 #2
0
ファイル: views.py プロジェクト: erikgotera/codes
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)
コード例 #3
0
ファイル: views.py プロジェクト: imclab/dunya
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)
コード例 #4
0
ファイル: views.py プロジェクト: darad/dunya
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)
コード例 #5
0
ファイル: views.py プロジェクト: imclab/dunya
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)
コード例 #6
0
ファイル: views.py プロジェクト: erikgotera/codes
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)
コード例 #7
0
ファイル: views.py プロジェクト: imclab/dunya
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)
コード例 #8
0
ファイル: views.py プロジェクト: darad/dunya
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)