<commit_before>from rest_framework import serializers
from images.models import Gallery, Image


class GallerySerializer(serializers.ModelSerializer):
    class Meta:
        model = Gallery
        fields = ('uuid', 'user', 'updated', 'rel_start', 'rel_end', 'title', 'private')


class ImageSerializer(serializers.ModelSerializer):
    full_url = serializers.SerializerMethodField()
    thumb_url = serializers.SerializerMethodField()
    tiny_thumb_url = serializers.SerializerMethodField()

    class Meta:
        model = Image
        fields = ('uuid', 'user', 'gallery', 'uploaded', 'title', 'uuid',
                  'full_url', 'thumb_url', 'tiny_thumb_url')

    def get_full_url(self, obj):
        return obj.full_fixed.url

    def get_thumb_url(self, obj):
        return obj.thumb.url

    def get_tiny_thumb_url(self, obj):
        return obj.tiny_thumb.url<commit_msg>made image serializer return uuid for gallery instead of id<commit_after>from rest_framework import serializers
from images.models import Gallery, Image


class GallerySerializer(serializers.ModelSerializer):
    class Meta:
        model = Gallery
        fields = ('uuid', 'user', 'updated', 'rel_start', 'rel_end', 'title', 'private')


class ImageSerializer(serializers.ModelSerializer):
    full_url = serializers.SerializerMethodField()
    thumb_url = serializers.SerializerMethodField()
    tiny_thumb_url = serializers.SerializerMethodField()
    gallery = serializers.CharField(source="gallery.uuid")

    class Meta:
        model = Image
        fields = ('uuid', 'user', 'gallery', 'uploaded', 'title', 'uuid',
                  'full_url', 'thumb_url', 'tiny_thumb_url')

    def get_full_url(self, obj):
        return obj.full_fixed.url

    def get_thumb_url(self, obj):
        return obj.thumb.url

    def get_tiny_thumb_url(self, obj):
        return obj.tiny_thumb.url
{'fraction_non_alphanumeric': 0.10986666666666667, 'fraction_numerical': 0.0, 'mean_word_length': 3.6550868486352357, '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': '1837473', 'n_tokens_mistral': 542, 'n_tokens_neox': 525, 'n_words': 130}