To retrieve a particular object in your API you should implement it in a method called "retrieve", not "get", if I remember correctly
On Tue, Sep 5, 2017 at 10:28 AM, Rakhee Menon <[email protected]> wrote: > 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 [email protected]. > To post to this group, send email to [email protected]. > 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 > <https://groups.google.com/d/msgid/django-users/8f1a1edf-ed7f-490f-8c29-73aa31531a3b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CALn3ei3fp0uWeBr0a6ycGvw03ZKqzXRdepJpD%2B34VKxTQV-4hQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

