Skip to content

Commit

Permalink
Merge pull request #205 from bounswe/kaan-post-page
Browse files Browse the repository at this point in the history
bug fix and add default pp
  • Loading branch information
kaanguneyli authored May 11, 2024
2 parents 82d9bdd + 32ff67b commit 454f920
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions backend/nba_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,19 @@ def create_comment(request, post_id):
return HttpResponse("Post not found", status=404)
return render(request, 'comment.html', {'post_id': post_id})

"""
def post_detail(request, post_id):
post = Post.objects.get(post_id=post_id)
comments = Comment.objects.get(post = post) #post.comments.all()
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 user_followings(request):
Expand Down

0 comments on commit 454f920

Please sign in to comment.