Assignment for 7 weeks#34
Open
rannie-kim wants to merge 15 commits into
Open
Conversation
BDlhj
approved these changes
May 6, 2023
BDlhj
left a comment
There was a problem hiding this comment.
PR 뿐만 아니라 주석도 열심히 작성해줬군요!!
덕분에 편했습니다ㅎㅎ 심화과제까지 하느라 수고 많았어요~~👏🏻👏🏻👏🏻
|
|
||
| ### 얘네가 class inner function 들! ### | ||
| def get(self, request): | ||
| posts = Post.objects.annotate(like_count=Count('like_users')).order_by('-like_count') |
| return Response({"detail": "Permission denied"}, status=status.HTTP_401_UNAUTHORIZED) | ||
|
|
||
| # request data로 CommentSerializer를 통해 Comment 객체 업데이트 | ||
| serializer = CommentSerializer(comment, data=request.data, partial=True) |
|
|
||
| class CommentListView(APIView): | ||
| def get(self, request): | ||
| # 쿼리 파라미터에서 post_id 가져오기 |
| # Post 객체를 찾을 수 없으면, 404 Not Found 반환 | ||
| # DoesNotExist는 Django에서 사용하는 예외입니다. | ||
| # 이 예외는 get() 쿼리 메소드를 사용하여 특정 모델 객체를 조회하려고 할 때, 일치하는 객체를 찾을 수 없는 경우 발생합니다. | ||
| except Post.DoesNotExist: |
Comment on lines
+95
to
+96
| if comment is None: | ||
| return Response({"detail": "Not found."}, status=status.HTTP_404_NOT_FOUND) |
Contributor
Author
There was a problem hiding this comment.
요 친구는 위에 코드를 적고 나서 지웠어야 하는데 지워지지 않은 친구네요..! 꼼꼼히 봐주셔서 감사합니다~ :-)
rannie-kim
commented
May 8, 2023
rannie-kim
left a comment
Contributor
Author
There was a problem hiding this comment.
정성스레 써주신 리뷰 모두 확인하였습니다~!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[세미나]
Study 7 week : 7주차 세미나때 한 거
[과제]
Make layers of Comment Model : 코데 전에 혼자 해본 것
Submit 7 weeks assignment : 코데 날 마무리 한 것
Modify Post model thanks to hojoon : 호준이가 피드백 해줘서 코드 수정!
나영언니의 공지를 보기 전에 이미 PR 을 날려두었어서, 요렇게 보냅니다..ㅠ.ㅠ