title: The serializer field might be named incorrectly and not match any attribute or key on the `GenericRelatedObjectManager` instance
body: <p>I can't figure out why I'm getting this  error "The serializer field might be named incorrectly and not match any attribute or key on the <code>GenericRelatedObjectManager</code> instance. Original exception text was: 'GenericRelatedObjectManager' object has no attribute 'country'.".  I been working on this for days, Can someone help me please? What is wrong with my code? Thanks in advance.</p>
  
  <p>I want to create a nested serializer that has a CRUD functionality. Planning to use this in my DRF.</p>
  
  <p>I have 3 interrelated models namely Company, Address, and Country. </p>
  
  <ul>
  <li>Company model have a field called "<strong>address</strong>" and it's a GenericForeignKey.</li>
  <li>Address model have a field called "<strong>country</strong>" and it's ForeignKey.</li>
  <li>Country model is a CountryField(). I'm using django_countries plugin.  </li>
  </ul>
  
  <p><strong>Model Structure</strong></p>
  
  <pre><code>Company
   |__Address (GenericForeignKey)
      |___Country (ForeignKey)
  </code></pre>
  
  <p><strong>Company Model</strong></p>
  
  <pre><code>from django_countries.fields import CountryField
  
  class SalesClientCompany(models.Model):
              address = GenericRelation(
                  Address,
                  null=True,
                  blank=True,
              )
  </code></pre>
  
  <p><strong>Address Model</strong></p>
  
  <pre><code>class Address(models.Model):
  
      content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE,)
  
      object_id = models.UUIDField(
          primary_key=False,
          unique=False,
          default=uuid.uuid4,
          blank=True,
          null=True,
      )
  
      content_object = GenericForeignKey()
  
      country = models.ForeignKey(
          Country,
          verbose_name=_("Country"),
          to_field='country',
          blank=False,
          on_delete=models.CASCADE,
      )
  </code></pre>
  
  <p><strong>Country Model</strong></p>
  
  <pre><code>from django_countries.fields import CountryField
  
  class Country(SmardtAbstractHistory):
  
      country = CountryField(
          unique=True,
      )
  
      name = SmardtTranslateField(
          models.CharField(
              max_length=50,
              null=True,
          )
      )
  </code></pre>
  
  <p><strong>Serializers</strong></p>
  
  <pre><code>from rest_framework import serializers
  from django.contrib.contenttypes.models import ContentType, ContentTypeManager
  
  
  from models.client_companies import SalesClientCompany
  from country.models.countries import Country
  from models.addresses import Address
  
  
  class CountrySerializer(serializers.ModelSerializer):
  
      class Meta:
          model = Country
          fields = ('country',)
  
  
  class ClientCompanyAddressSerializer(serializers.ModelSerializer):
      country = CountrySerializer()
      # country = serializers.SlugRelatedField(queryset=Country.objects.all(), slug_field='country') 
      class Meta:
          model = Address
          fields = ('line_first', 'line_second', 'province', 'country',  'postal_code',)
  
  
  
  class ClientCompanySerializer(serializers.ModelSerializer):
  
      address = ClientCompanyAddressSerializer()
  
      class Meta:
          model = SalesClientCompany
          fields = ['id', 'name', 'address',  'email', 'phone', 'type', 'company_directory']
  
      def create(self, validated_data):
  
          company = SalesClientCompany(
              name=validated_data['name'],
              email=validated_data['email'],
              .....
          )
          company.save()
  
          content_type = ContentType.objects.get_for_model(SalesClientCompany)
  
          company_address = Address(
              content_type=content_type,
              object_id=company.pk,
              content_object=company,
              country=validated_data['address']['country'],
              .....
  
          )
  
          company_address.save()
  
          return company
  </code></pre>
  
  <p><strong>Inspect Serializer</strong></p>
  
  <pre><code>ClientCompanyAddressSerializer():
      line_first = CharField(allow_blank=True, label='Address Line 1', max_length=255, required=False)
      line_second = CharField(allow_blank=True, label='Address Line 2', max_length=255, required=False)
      province = CharField(allow_blank=True, label='State/Province/Region', max_length=255, required=False)
      country = SlugRelatedField(queryset=Country.objects.all(), slug_field='country')    
      postal_code = CharField(allow_blank=True, label='Zip/Postal Code', max_length=255, required=False)
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>class ClientCompanyCreate( generics.ListCreateAPIView ):
      queryset = SalesClientCompany.objects.all()
      serializer_class = ClientCompanySerializer
  </code></pre>