class ProducerSerializer(ModelSerializer):


    class Meta:
        model = Producer


class CarSerializer(ModelSerializer):
    producer = ProducerSerializer(read_only=True)


class Meta:
    model = Car
All fields in ModelSerializer django rest framework