<commit_before>from rest_framework import serializers

from myideas.core.models import Ideas


class IdeasModelSerializer(serializers.ModelSerializer):

    class Meta:
        model = Ideas
        fields = ('user', 'title', 'description', 'likes', 'slug', 'tags', 'created_at')
<commit_msg>update serializers<commit_after>from rest_framework import serializers

from myideas.core.models import Ideas


class IdeasModelSerializer(serializers.ModelSerializer):
    tags = serializers.StringRelatedField(many=True, read_only=True)
    username = serializers.ReadOnlyField(source='user.username')
    likes = serializers.ReadOnlyField(source='likes.count')

    class Meta:
        model = Ideas
        fields = ('id', 'username', 'title', 'description', 'likes', 'slug', 'created_at', 'tags')

{'fraction_non_alphanumeric': 0.11853720050441362, 'fraction_numerical': 0.0, 'mean_word_length': 5.015151515151516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5372562', 'n_tokens_mistral': 229, 'n_tokens_neox': 222, 'n_words': 53}