<commit_before>from django.forms import widgets
from rest_framework import serializers
from inventory.models import InventoryItem
from server.models import *

class InventoryItemSerializer(serializers.ModelSerializer):
    class Meta:
        model = InventoryItem
        exclude = ('id', 'machine')

class BusinessUnitSerializer(serializers.ModelSerializer):
    class Meta:
        model = BusinessUnit

class MachineGroupSerializer(serializers.ModelSerializer):
    #business_unit = BusinessUnitSerializer()
    class Meta:
        model = MachineGroup

class FactSerializer(serializers.ModelSerializer):
    class Meta:
        model = Fact
        exclude = ('id', 'machine')

class ConditionSerializer(serializers.ModelSerializer):
    class Meta:
        model = Condition
        exclude = ('id', 'machine')


class PendingAppleUpdateSerializer(serializers.ModelSerializer):
    class Meta:
        model = PendingAppleUpdate
        exclude = ('id', 'machine')

class PendingUpdateSerializer(serializers.ModelSerializer):
    class Meta:
        model = PendingUpdate
        exclude = ('id', 'machine')

class MachineSerializer(serializers.ModelSerializer):
    facts = FactSerializer(many=True, required=False)
    conditions = ConditionSerializer(many=True, required=False)
    pending_apple_updates = PendingAppleUpdateSerializer(many=True, required=False)
    pending_updates = PendingUpdateSerializer(many=True, required=False)
    #machine_group = MachineGroupSerializer()
    class Meta:
        model = Machine
        exclude = ('id',)<commit_msg>Stop hiding IDs in API (fixes issue #19)<commit_after>from django.forms import widgets
from rest_framework import serializers
from inventory.models import InventoryItem
from server.models import *

class InventoryItemSerializer(serializers.ModelSerializer):
    class Meta:
        model = InventoryItem
        exclude = ('machine')

class BusinessUnitSerializer(serializers.ModelSerializer):
    class Meta:
        model = BusinessUnit

class MachineGroupSerializer(serializers.ModelSerializer):
    #business_unit = BusinessUnitSerializer()
    class Meta:
        model = MachineGroup

class FactSerializer(serializers.ModelSerializer):
    class Meta:
        model = Fact
        exclude = ('machine')

class ConditionSerializer(serializers.ModelSerializer):
    class Meta:
        model = Condition
        exclude = ('machine')


class PendingAppleUpdateSerializer(serializers.ModelSerializer):
    class Meta:
        model = PendingAppleUpdate
        exclude = ('machine')

class PendingUpdateSerializer(serializers.ModelSerializer):
    class Meta:
        model = PendingUpdate
        exclude = ('machine')

class MachineSerializer(serializers.ModelSerializer):
    facts = FactSerializer(many=True, required=False)
    conditions = ConditionSerializer(many=True, required=False)
    pending_apple_updates = PendingAppleUpdateSerializer(many=True, required=False)
    pending_updates = PendingUpdateSerializer(many=True, required=False)
    #machine_group = MachineGroupSerializer()
    class Meta:
        model = Machine
        # exclude = ('id',)
{'fraction_non_alphanumeric': 0.08139163740823492, 'fraction_numerical': 0.0006383657835939994, 'mean_word_length': 4.120915032679738, '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': '7203736', 'n_tokens_mistral': 786, 'n_tokens_neox': 761, 'n_words': 193}