- Post 모델에 is_private 필드 추가 - 비공개 게시글은 작성자만 목록/상세에서 조회 가능 - 공개/비공개 토글 기능 지원 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -108,7 +108,8 @@ class PostSerializer(serializers.ModelSerializer):
|
||||
'author_id', 'author_name',
|
||||
'created_at', 'updated_at',
|
||||
'comment_count', 'tags', 'tag_names',
|
||||
'attachments', 'attachment_ids'
|
||||
'attachments', 'attachment_ids',
|
||||
'is_private'
|
||||
]
|
||||
read_only_fields = ['author_id', 'author_name', 'created_at', 'updated_at']
|
||||
|
||||
@ -178,7 +179,8 @@ class PostListSerializer(serializers.ModelSerializer):
|
||||
fields = [
|
||||
'id', 'title',
|
||||
'author_name', 'created_at', 'updated_at',
|
||||
'comment_count', 'tags', 'thumbnail'
|
||||
'comment_count', 'tags', 'thumbnail',
|
||||
'is_private'
|
||||
]
|
||||
|
||||
def get_comment_count(self, obj):
|
||||
|
||||
Reference in New Issue
Block a user