<filename>python/django/12-Django-Rest-Framework/my_awesome_django_project/my_awesome_api/serializers.py<gh_stars>0
from rest_framework import serializers

from my_awesome_api.models import Person, Species

class PersonSerializer(serializers.ModelSerializer):
   class Meta:
       model = Person
       fields = ('name', 'birth_year', 'eye_color', 'species')


class SpeciesSerializer(serializers.ModelSerializer):
   class Meta:
       model = Species
       fields = ('name', 'classification', 'language')