If your using a values_list command, try adding the `flat=True` argument.
Or you could set the depth on your Meta parameters: 
https://www.django-rest-framework.org/api-guide/serializers/#specifying-nested-serialization

Benny

On Feb 1, 2021, at 6:17 AM, narendra...@gmail.com <narendrathapa...@gmail.com> 
wrote:

i have  a two table and want to fetch data based on their relationship using 
serializer. I'm able to get nested data like

{
'ID':1,
'name':'abc',
'address':[
{
....
}
]


but i want it as in single not as nested
{
.....
}

can any body help me with sample code or reference me a good example so i can 
understand


--
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+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/551a9e41-d743-40d2-bab9-f4e6eb8ea941n%40googlegroups.com<https://groups.google.com/d/msgid/django-users/551a9e41-d743-40d2-bab9-f4e6eb8ea941n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CH2PR14MB3913607AF402D3532C3A6A07C0B59%40CH2PR14MB3913.namprd14.prod.outlook.com.

Reply via email to