""" Serializer used for the used shared models among the apps. """ from rest_framework import serializers from .models import ButtonBox, ButtonBoxUse class ButtonBoxSerializer(serializers.ModelSerializer): """The serializer for the information about the button box. """ class Meta: """ Meta class for the ButtonBoxSerializer. Used for returning only the information needed for the ButtonBox model. """ model = ButtonBox fields = [ # "id", "name", # "pin_number", "pin_button", "pin_led", ] class ButtonBoxUseSerializer(serializers.ModelSerializer): """The serializer for the information about the button box uses. """ class Meta: """ Meta class for the ButtonBoxSerializer. Used for returning only the information needed for the ButtonBoxUse model. """ model = ButtonBoxUse fields = [ # "id", "box_used", "box_name", "date", ]