Re: Django rext framework join multiple table without nested data

2021-02-03 Thread Kelechi Divine
*I'm grateful for the images you've sent to me! It was helpful, and it's a good thing to receive a help at the moment!* On Tue, 2 Feb 2021 at 16:57, narendra thapa wrote: > here are the images of mine code by using the value > _list flat = True and with out it. > > i need a flatten json output n

Re: Django rext framework join multiple table without nested data

2021-02-01 Thread Benny M
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 wrote: i have a

Django rext framework join multiple table without nested data

2021-02-01 Thread narendra...@gmail.com
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