title: 'QuerySet' object has no attribute 'pk'
body: <pre><code>#models
  class Student(models.Model):
  firstname =  models.CharField(max_length=100,default='ll')
  lastname = models.CharField(max_length=100,default='fewf')
  id_code = models.CharField(max_length=10,default=0,unique=True)
  melli = models.CharField(max_length=30,default=0,unique=True)
  personal_pic = models.ImageField(upload_to=studentFile)
  major = models.ForeignKey(Major, on_delete=models.PROTECT,default=0)
  date_of_start = models.DateField(default=datetime.date.today)
  
  def __str__(self):
      return self.id_code
  
  #views
  class loginView(APIView):
  def post(self, request):
      data = request.data
      melli = data.get('melli')
      id_code = data.get('id_code')
      student = Student.objects.filter(id_code=id_code,melli=melli)
      if not student.exists():
         return Response('error')
      serializer = StudentSerializer(student,data=data)
      serializer.is_valid()
      return Response(serializer.data)
  </code></pre>
  <p>when i try to submit a post request i was excepted to recive a response but i got an error. how can i solve it?</p>