Re: Expecting JSON object instead of JSON Array

2020-04-22 Thread Andréas Kühne
You are doing a get to the default route for the viewset I am guessing? That would return a list - because you are getting ALL records and not one specific record. If you added more records to the database you will also see more in the list. See here for more information: https://www.django-rest-

Expecting JSON object instead of JSON Array

2020-04-21 Thread Salah Abdul Gafoor
In my django application with database engine djongo, I'm trying to return a JSON response by retrieving from my database. But, I'm receiving JSON array instead of JSON object. Currently, there is only one record in my database. Please see the code below. model.py class bloodDonors(models.Mode

Expecting JSON object instead of JSON Array

2020-04-21 Thread Salah Abdul Gafoor
In my django application with database engine djongo, I'm trying to return a JSON response by retrieving from my database. But, I'm receiving JSON array instead of JSON object. Currently, there is only one record in my database. Please see the code below. model.py class bloodDonors(models.Mode