Example #1
0
def profile_endorsements(request, username):
    eligible_profiles = Profile.objects.exclude(pk=request.profile.id)
    profile = get_object_or_404(
        eligible_profiles, user__username=username)
    return feed(request, item_type=Endorsement, recipient=profile,
                template='profile_endorsements.html',
                extra_context={'profile': profile})
Example #2
0
def profile_endorsements(request, username):
    eligible_profiles = Profile.objects.exclude(pk=request.profile.id)
    profile = get_object_or_404(eligible_profiles, user__username=username)
    return feed(request,
                item_type=Endorsement,
                recipient=profile,
                template='profile_endorsements.html',
                extra_context={'profile': profile})
Example #3
0
def profile_posts(request, username):
    profile = get_object_or_404(Profile, user__username=username)
    if profile == request.profile:
        template = 'my_posts.html'
        extra_context = {}
    else:
        template = 'profile_posts.html'    
        extra_context = {'profile': profile}
    return feed(request, item_type=Post, poster=profile, template=template,
                extra_context=extra_context)
Example #4
0
def profile_posts(request, username):
    profile = get_object_or_404(Profile, user__username=username)
    if profile == request.profile:
        template = 'my_posts.html'
        extra_context = {}
    else:
        template = 'profile_posts.html'
        extra_context = {'profile': profile}
    return feed(request,
                item_type=Post,
                poster=profile,
                template=template,
                extra_context=extra_context)