title: Original exception text was: 'QuerySet' object has no attribute 'name' using django rest framework
body: <p>I'm learning Django and i got to this error and I couldn't find the solution.</p>
  
  <p>Here are my <strong>models</strong></p>
  
  <pre><code>class Retailer(models.Model):
      id = models.AutoField(primary_key=True)
      name = models.CharField(max_length=255)
      website = models.CharField(max_length=255)
  
      def __str__(self):
          return str(self.id)
  
  class Product(models.Model):
      id = models.AutoField(primary_key=True)
      price = models.IntegerField(default=None, null=True)
      name = models.CharField(max_length=255)
      retailer = models.ForeignKey(Retailer,on_delete=models.CASCADE,related_name='retailer_info')
      is_active = models.BooleanField(default=False)
      def __str__(self):
          return str(self.id)
  </code></pre>
  
  <p>And here are my <strong>serializers</strong></p>
  
  <pre><code>class ProductSerializer(serializers.ModelSerializer):
      class Meta:
          model = Product
          fields = '__all__'
  
  class RetailerSerializer(serializers.ModelSerializer):
      products = ProductSerializer(many=True, read_only=True)
      class Meta:
          model = Retailer
          fields = ['name', 'website', 'products']
  </code></pre>
  
  <p>And here's my <strong>view</strong></p>
  
  <pre><code>class RetailerList(APIView):
      def get(self, request):
          retailer = Retailer.objects.all()
          serializer = RetailerSerializer(retailer)
          return Response(serializer.data)
  </code></pre>
  
  <p>And here's my <strong>url</strong></p>
  
  <pre><code>path('retailer', views.RetailerList.as_view()),
  </code></pre>
  
  <p>But when I submit a get request on <em>127.0.0.1:8000/retailer</em> i get this error:</p>
  
  <blockquote>
    <p>AttributeError at /product
    Got AttributeError when attempting to get a value for field <code>name</code> on serializer <code>RetailerSerializer</code>.
    The serializer field might be named incorrectly and not match any attribute or key on the <code>QuerySet</code> instance.
    Original exception text was: 'QuerySet' object has no attribute 'name'.
    What's the problem?</p>
  </blockquote>