title: Exception Value: 'many' is an invalid keyword argument for this function
body: <p>, Exception Value:    'many' is an invalid keyword argument for this function,Exception Value:    'many' is an invalid keyword argument for this function,Exception Value:    'many' is an invalid keyword argument for this function,Exception Value:    'many' is an invalid keyword argument for this function,Exception Value:    'many' is an invalid keyword argument for this function,Exception Value:    'many' is an invalid keyword argument for this function, Exception Value:   'many' is an invalid keyword argument for this function,Exception Value:    'many' is an invalid keyword argument for this function,Exception Value:    'many' is an invalid keyword argument for this function,Exception Value:    'many' is an invalid keyword argument for this function,Exception Value:    'many' is an invalid keyword argument for this function,Exception Value:    'many' is an invalid keyword argument for this function
      views.py</p>
  
  <pre><code>from django.shortcuts import render
  from rest_framework import status
  from rest_framework.decorators import api_view
  from rest_framework.response import Response
  from student.models import Student
  from student.serializers import StudentSerializer
  
  
  @api_view(['GET', 'POST'])
  def Student_list(request):
  
      if request.method == 'GET':
          snippets = Student.objects.all()
          serializer = Student(Student, many=True)
          return Response(serializer.data)
  
      elif request.method == 'POST':
          serializer = Student(data=request.data)
          if serializer.is_valid():
              serializer.save()
              return Response(serializer.data, status=status.HTTP_201_CREATED)
          return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  
  @api_view(['GET', 'PUT', 'DELETE'])
  def Student_detail(request, pk):
  
      try:
          snippet = Student.objects.get(pk=pk)
      except Student.DoesNotExist:
          return Response(status=status.HTTP_404_NOT_FOUND)
  
      if request.method == 'GET':
          serializer = Student(snippet)
          return Response(serializer.data)
  
      elif request.method == 'PUT':
          serializer = Student(snippet, data=request.data)
          if serializer.is_valid():
              serializer.save()
              return Response(serializer.data)
          return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  
      elif request.method == 'DELETE':
          snippet.delete()
          return Response(status=status.HTTP_204_NO_CONTENT)
  
  models.py
  
  from django.db import models
  
  class Student(models.Model):
      id=models.IntegerField(primary_key=True)
      fname=models.CharField(max_length=20)
      lname=models.CharField(max_length=20)
      cnt=models.IntegerField()
      class Meta:
          ordering=('id',)
  
  serializers.py
  
  from rest_framework import serializers
  from student.models import Student
  
  class StudentSerializer(serializers.ModelSerializer):
      class Meta:
          model = Student
          fields=('id','fname','lname','cnt')
  
          def create (self,validated_data):
              return Student.objects.create(**validated_data)
  
          def update(self,instance,validated_data):
              instance.id=validated_data.get('id',instance.id)
              instance.fname=validated_data.get('fname',instance.fname)
              instance.lname=validated_data.get('lname',instance.lname)
              instance.cnt=validated_data.get('cnt',instance.cnt)
              instance.save()
              return instance
  </code></pre>