CODE:
class FormList(APIView):
def get(self, request, id):
import ipdb;ipdb.set_trace()
item_obj = ItemMaster.objects.get(id=id)
serializer = ItemMasterSerializer(forms,many=False)
return Response(serializer.data, content_type="application/json")
def get(self,request):
forms = ItemMaster.objects.all()
serializer=ItemMasterSerializer(forms,many=True)
return Response(serializer.data, content_type="application/json")
I get this error.django-got-an-unexpected-keyword-argument-id.
when i try to access a specific item..Please can anyone suggest how to solve this bug using APIViews and not by using viewset as there is lot of customization in my API.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8f1a1edf-ed7f-490f-8c29-73aa31531a3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment