I seem to be stuck and am not sure which is the best direction to take.
I have a few apps in my project and would like to combine three views into one template.
I have a userprofile in which I would like to display his info, latest news feeds and also his photos
Through this I am making use of jQuery tabs
I have defined my three tabs out of which one calls on a regular div and the other two are urls that get called in.
<a href="wall/recent">wall</a>
and <a href="photos/recent">photos</a>
the address bar reads the following when on a users profile
http://localhost:8000/profiles/profile_name/
in my views.py
for wall
and photos
looks like the following
@login_required
def index(request, template_name='wall/_index.html'):
photos = Photos.objects.filter(user=request.user).order_by('-id')
context = { 'photos': photos, }
return render_to_response(template_name, context,
context_instance=RequestContext(request))
But if I then look at MY profile it is fine, but whenever I switch to another users profile it sill seems to display some of my information.
I know that request.user is looking at the logged in user, how do I obtain that user in the address bar and pass it on so it displays the correct info ie if profile_name
= john then displays johns photos, recent wall items etc.