from rest_framework import serializers
from .models import Animal

class AnimalSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Animal
        fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother')
from rest_framework import serializers
from .models import Animal

class AnimalSerializer(serializers.ModelSerializer):
    class Meta:
        model = Animal
        fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother')
Change sanitizer to normal model sanitizer, so it sends ids of parents.
Change sanitizer to normal model sanitizer, so it sends ids of parents.

  from rest_framework import serializers
  from .models import Animal
  
- class AnimalSerializer(serializers.HyperlinkedModelSerializer):
+ class AnimalSerializer(serializers.ModelSerializer):
      class Meta:
          model = Animal
          fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother')
Change sanitizer to normal model sanitizer, so it sends ids of parents.
## Code Before:
from rest_framework import serializers
from .models import Animal

class AnimalSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Animal
        fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother')
## Instruction:
Change sanitizer to normal model sanitizer, so it sends ids of parents.
## Code After:
from rest_framework import serializers
from .models import Animal

class AnimalSerializer(serializers.ModelSerializer):
    class Meta:
        model = Animal
        fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother')