Beispiel #1
0
class PostCommentSerializer(serializers.ModelSerializer):
    commenter = PostCommenterField(
        post_commenter_serializer=PostCommentCommenterSerializer,
        community_membership_serializer=
        PostCommenterCommunityMembershipSerializer)
    replies = RepliesField(
        post_comment_reply_serializer=PostCommentReplySerializer)
    replies_count = RepliesCountField()

    class Meta:
        model = PostComment
        fields = ('commenter', 'text', 'created', 'replies_count', 'replies',
                  'is_edited', 'id')
Beispiel #2
0
class GetPostCommentSerializer(serializers.ModelSerializer):
    commenter = PostCommenterField(
        post_commenter_serializer=CommonPublicUserSerializer,
        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()
    hashtags = CommonHashtagSerializer(many=True)

    class Meta:
        model = PostComment
        fields = ('commenter', 'text', 'language', 'created',
                  'reactions_emoji_counts', 'replies_count', 'reaction',
                  'is_edited', 'is_muted', 'hashtags', 'id')
Beispiel #3
0
class PostCommentSerializer(serializers.ModelSerializer):
    commenter = PostCommenterField(
        post_commenter_serializer=PostCommentCommenterSerializer,
        community_membership_serializer=
        PostCommenterCommunityMembershipSerializer)
    replies = RepliesField(
        post_comment_reply_serializer=PostCommentReplySerializer)
    replies_count = RepliesCountField()
    reactions_emoji_counts = PostCommentReactionsEmojiCountField(
        emoji_count_serializer=PostCommentReactionEmojiCountSerializer)
    reaction = PostCommentReactionField(
        post_comment_reaction_serializer=PostCommentReactionSerializer)
    is_muted = PostCommentIsMutedField()
    language = PostCommentLanguageSerializer()

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