Skip to content

Commit

Permalink
try of bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kaanguneyli authored May 13, 2024
1 parent 0228f15 commit f2f18ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/nba_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,18 @@ def post_detail(request, post_id):
print({'post': post, 'comments': comments})
return render(request, 'post_detail.html', {'post': post, 'comments': comments})
"""

"""
def post_detail(request, post_id):
post = Post.objects.get(post_id=post_id)
comments = Comment.objects.filter(post = post) #post.comments.all()
print({'post': post, 'image': post.image, 'comments': comments})
return render(request, 'post_detail.html', {'post': post, 'image': post.image, 'comments': comments})
"""
def post_detail(request, post_id):
post = Post.objects.get(post_id=post_id)
comments = post.comments.all()
print({'post': post, 'image': post.image.url, 'comments': comments})
return render(request, 'post_detail.html', {'post': post, 'image': post.image.url, 'comments': comments})


def user_followings(request):
Expand Down

0 comments on commit f2f18ac

Please sign in to comment.