<commit_before>from rest_framework import serializers
from workflows.models import *
#from rest_framework.reverse import reverse


class ConnectionSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Connection


class InputSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Input
        exclude = ('value',)


class OutputSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Output
        exclude = ('value',)


class WidgetListSerializer(serializers.HyperlinkedModelSerializer):
   class Meta:
       model = Widget
       exclude = ('abstract_widget',)


class WidgetSerializer(serializers.HyperlinkedModelSerializer):
    inputs = InputSerializer(many=True, read_only=True)
    outputs = OutputSerializer(many=True, read_only=True)
    class Meta:
        model = Widget
        exclude = ('abstract_widget',)


class WorkflowListSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Workflow
        fields = ('id', 'name', 'public', 'description', 'url')


class WorkflowSerializer(serializers.HyperlinkedModelSerializer):
    widgets = WidgetSerializer(many=True, read_only=True)
    class Meta:
        model = Workflow
        fields = ('id', 'name', 'public', 'description', 'widgets', 'url')<commit_msg>nested connections<commit_after>from rest_framework import serializers
from workflows.models import *
#from rest_framework.reverse import reverse


class ConnectionSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Connection


class InputSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Input
        exclude = ('value',)


class OutputSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Output
        exclude = ('value',)


class WidgetListSerializer(serializers.HyperlinkedModelSerializer):
   class Meta:
       model = Widget
       exclude = ('abstract_widget',)


class WidgetSerializer(serializers.HyperlinkedModelSerializer):
    inputs = InputSerializer(many=True, read_only=True)
    outputs = OutputSerializer(many=True, read_only=True)
    class Meta:
        model = Widget
        exclude = ('abstract_widget',)


class WorkflowListSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Workflow
        fields = ('id', 'name', 'public', 'description', 'url')


class WorkflowSerializer(serializers.HyperlinkedModelSerializer):
    widgets = WidgetSerializer(many=True, read_only=True)
    connections = ConnectionSerializer(many=True, read_only=True)
    class Meta:
        model = Workflow
        fields = ('id', 'name', 'public', 'description', 'widgets', 'connections', 'url')
{'fraction_non_alphanumeric': 0.09573699421965318, 'fraction_numerical': 0.0, 'mean_word_length': 4.156424581005586, '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': '4005669', 'n_tokens_mistral': 727, 'n_tokens_neox': 701, 'n_words': 170}