예제 #1
0
class NotificationPostCommentParentSerializer(serializers.ModelSerializer):
    commenter = PostCommentCommenterSerializer()
    is_muted = PostCommentIsMutedField()

    class Meta:
        model = PostComment
        fields = ('id', 'commenter', 'text', 'created', 'is_edited',
                  'is_muted')
예제 #2
0
class NotificationPostCommentSerializer(serializers.ModelSerializer):
    commenter = PostCommentCommenterSerializer()
    post = NotificationPostSerializer()
    parent_comment = NotificationPostCommentParentSerializer()
    is_muted = PostCommentIsMutedField()
    language = PostCommentLanguageSerializer()

    class Meta:
        model = PostComment
        fields = ('id', 'commenter', 'language', 'text', 'post', 'created',
                  'parent_comment', 'is_muted')
예제 #3
0
class NotificationPostCommentSerializer(serializers.ModelSerializer):
    commenter = CommonPublicUserSerializer()
    post = NotificationPostSerializer()
    parent_comment = NotificationPostCommentParentSerializer()
    is_muted = PostCommentIsMutedField()
    language = PostCommentLanguageSerializer()
    hashtags = CommonHashtagSerializer(many=True)

    class Meta:
        model = PostComment
        fields = ('id', 'commenter', 'language', 'text', 'post', 'created',
                  'parent_comment', 'is_muted', 'hashtags')
예제 #4
0
class PostCommentReplySerializer(serializers.ModelSerializer):
    commenter = PostCommenterField(
        post_commenter_serializer=PostCommentCommenterSerializer,
        community_membership_serializer=
        PostCommenterCommunityMembershipSerializer)
    parent_comment = PostCommentReplyParentSerializer()
    reactions_emoji_counts = PostCommentReactionsEmojiCountField(
        emoji_count_serializer=PostEmojiCountSerializer)
    reaction = PostCommentReactionField(
        post_comment_reaction_serializer=PostCommentReactionSerializer)
    is_muted = PostCommentIsMutedField()

    class Meta:
        model = PostComment
        fields = ('commenter', 'reactions_emoji_counts', 'reaction', 'text',
                  'created', 'parent_comment', 'is_edited', 'is_muted', 'id')
예제 #5
0
class PostCommentReplySerializer(serializers.ModelSerializer):
    parent_comment = PostCommentRepliesParentCommentSerializer()
    commenter = PostCommenterField(
        post_commenter_serializer=PostCommentCommenterSerializer,
        community_membership_serializer=
        PostCommenterCommunityMembershipSerializer)
    reactions_emoji_counts = PostCommentReactionsEmojiCountField(
        emoji_count_serializer=PostCommentReactionEmojiCountSerializer)
    reaction = PostCommentReactionField(
        post_comment_reaction_serializer=PostCommentReactionSerializer)
    is_muted = PostCommentIsMutedField()
    language = PostCommentLanguageSerializer()
    hashtags = CommonHashtagSerializer(many=True)

    class Meta:
        model = PostComment
        fields = ('commenter', 'parent_comment', 'text', 'language', 'created',
                  'is_edited', 'is_muted', 'reactions_emoji_counts', 'id',
                  'reaction', 'hashtags')
예제 #6
0
class GetPostCommentSerializer(serializers.ModelSerializer):
    commenter = PostCommenterField(post_commenter_serializer=GetPostCommentCommenterSerializer,
                                   community_membership_serializer=GetPostCommenterCommunityMembershipSerializer)
    replies_count = RepliesCountField()
    reactions_emoji_counts = PostCommentReactionsEmojiCountField(
        emoji_count_serializer=GetPostCommentReactionEmojiCountSerializer)
    reaction = PostCommentReactionField(post_comment_reaction_serializer=GetPostCommentReactionSerializer)
    is_muted = PostCommentIsMutedField()
    language = PostCommentLanguageSerializer()

    class Meta:
        model = PostComment
        fields = (
            'commenter',
            'text',
            'language',
            'created',
            'reactions_emoji_counts',
            'replies_count',
            'reaction',
            'is_edited',
            'is_muted',
            'id'
        )