Re: 'Article' object is not iterable ,why this error is popping up,while fetching data using primary no

2020-11-04 Thread Ashutosh Mishra
Thanks sir,,,solved successfully On Wed 4 Nov, 2020, 17:29 Michael Goffioul, wrote: > > https://www.django-rest-framework.org/api-guide/serializers/#dealing-with-multiple-objects > > You specify many=True in the serializer constructor; hence the serializer > expects a list of objects. You

Re: 'Article' object is not iterable ,why this error is popping up,while fetching data using primary no

2020-11-04 Thread Michael Goffioul
https://www.django-rest-framework.org/api-guide/serializers/#dealing-with-multiple-objects You specify many=True in the serializer constructor; hence the serializer expects a list of objects. You provide a single object; hence you get an error about argument not being iterable. On Wed, Nov 4,

Re: 'Article' object is not iterable ,why this error is popping up,while fetching data using primary no

2020-11-03 Thread Ashutosh Mishra
I want to fetch a particular entry by using primary key,suppose if I put 1 the entry associated with 1 will appear On Wed 4 Nov, 2020, 12:01 Xavier Ordoquy, wrote: > The question is, what are you trying to do and what outcome are you > expecting ? > > Le 4 nov. 2020 à 07:28, Ashutosh Mishra a

Re: 'Article' object is not iterable ,why this error is popping up,while fetching data using primary no

2020-11-03 Thread Xavier Ordoquy
The question is, what are you trying to do and what outcome are you expecting ? > Le 4 nov. 2020 à 07:28, Ashutosh Mishra a écrit > : > > So how can I resolve this? > > On Wed 4 Nov, 2020, 11:56 Xavier Ordoquy, > wrote: > Hi, > > Please, paste your code in the

Re: 'Article' object is not iterable ,why this error is popping up,while fetching data using primary no

2020-11-03 Thread Ashutosh Mishra
So how can I resolve this? On Wed 4 Nov, 2020, 11:56 Xavier Ordoquy, wrote: > Hi, > > Please, paste your code in the mail instead of screenshots, it makes it > hard to read. > In your view, you are passing an Article instance to your serializer along > with the many=True keyword which means the

Re: 'Article' object is not iterable ,why this error is popping up,while fetching data using primary no

2020-11-03 Thread Xavier Ordoquy
Hi, Please, paste your code in the mail instead of screenshots, it makes it hard to read. In your view, you are passing an Article instance to your serializer along with the many=True keyword which means the serializer will expect an iterable of Articles as the error suggests. Regards, Xavier