<commit_before>from .models import ContainerType, ComponentType, Container, Component
from rest_framework import serializers


class ContainerTypeSerializer(serializers.ModelSerializer):
    class Meta:
        model = ContainerType
        fields = ("slug",)


class ComponentTypeSerializer(serializers.ModelSerializer):
    class Meta:
        model = ComponentType
        fields = ("slug",)


class ComponentSerializer(serializers.ModelSerializer):
    type = ComponentTypeSerializer(
        many=False,
        read_only=True
    )

    class Meta:
        model = Component
        fields = ("id", "title", "slug", "dev_description", "type", "weight", "content", "json")


class SubContainerSerializer(serializers.ModelSerializer):
    type = ContainerTypeSerializer(
        many=False,
        read_only=True
    )

    components = ComponentSerializer(
        many=True,
        read_only=True
    )

    class Meta:
        model = Container
        fields = ("id", "title", "slug", "dev_description", "type", "weight", "containers", "components")
        depth = 3


class ContainerSerializer(serializers.ModelSerializer):
    type = ContainerTypeSerializer(
        many=False,
        read_only=True
    )

    containers = SubContainerSerializer(
        many=True,
        read_only=True
    )

    components = ComponentSerializer(
        many=True,
        read_only=True
    )

    class Meta:
        model = Container
        fields = ("id", "title", "slug", "dev_description", "get_type", "weight", "containers", "components")
        depth = 3


<commit_msg>- type field<commit_after>from .models import ContainerType, ComponentType, Container, Component
from rest_framework import serializers


class ContainerTypeSerializer(serializers.ModelSerializer):
    class Meta:
        model = ContainerType
        fields = ("slug",)


class ComponentTypeSerializer(serializers.ModelSerializer):
    class Meta:
        model = ComponentType
        fields = ("slug",)


class ComponentSerializer(serializers.ModelSerializer):
    type = ComponentTypeSerializer(
        many=False,
        read_only=True
    )

    class Meta:
        model = Component
        fields = ("id", "title", "slug", "dev_description", "type", "weight", "content", "json")


class SubContainerSerializer(serializers.ModelSerializer):
    type = ContainerTypeSerializer(
        many=False,
        read_only=True
    )

    components = ComponentSerializer(
        many=True,
        read_only=True
    )

    class Meta:
        model = Container
        fields = ("id", "title", "slug", "dev_description", "type", "weight", "containers", "components")
        depth = 3


class ContainerSerializer(serializers.ModelSerializer):
    # type = ContainerTypeSerializer(
    #     many=False,
    #     read_only=True
    # )

    containers = SubContainerSerializer(
        many=True,
        read_only=True
    )

    components = ComponentSerializer(
        many=True,
        read_only=True
    )

    class Meta:
        model = Container
        fields = ("id", "title", "slug", "dev_description", "get_type", "weight", "containers", "components")
        depth = 3



{'fraction_non_alphanumeric': 0.10557831705011031, 'fraction_numerical': 0.0012606366214938543, 'mean_word_length': 2.8519417475728157, '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': '4025544', 'n_tokens_mistral': 853, 'n_tokens_neox': 834, 'n_words': 202}