Beispiel #1
0
 def get(self, request):
     wall = WallController()
     if request.GET.get('page','home') != 'profile':
         wall = wall.get_public_wall(request.USER)
     else:
         try:
             profile = User.objects\
                         .filter(username=request.GET['username'])\
                         .exclude(meta=None)[0]
         except Exception, err:
             raise Http404
         is_friend = profile.friends.filter(id=request.USER.id).count()
         if profile.id==request.USER.id:
             privacy = '1,2,3'
         elif is_friend:
             privacy = '2,3'
         else:
             privacy = '2'
         wall = wall.get_single_user_wall(profile,privacy)
Beispiel #2
0
        privacy = '2,3'
    else:
        privacy = '2'


    try:
        profile.name = profile.name.split(' ')[0]
    except: pass

    wall = WallController()

    

    RES = {
        'USER': profile,
        "WALL": wall.get_single_user_wall(profile,privacy, 0, 10),
        'IS_OWNER': is_owner,
        'IS_FRIEND': is_friend
    }

    return render_to_response(
        'profile.tpl',
        RES,
        context_instance = RequestContext(request)
    )


@require_login
def friends(request):

    try: