def addFriend(request, user_id): user1 = UserProfile.objects.get(pk=request.session['conectado']) user2 = UserProfile.objects.get(pk=user_id) user1.amigos.add(user2) user1.save() return imageList(request, user_id=user_id)
def repic(request, img_id, user_id): img = Image.objects.get(pk=img_id) user = User.objects.get(pk=request.session['conectado']) img.repicers.add(user) img.save() return imageList(request, user_id=user_id)