*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 <narendrathapa...@gmail.com>
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 not a nested one can you help me with that?
>
> On Tue, Feb 2, 2021 at 11:56 AM Benny M <chibe...@outlook.com> wrote:
>
>> 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.
>> 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
>> <https://groups.google.com/d/msgid/django-users/CH2PR14MB3913607AF402D3532C3A6A07C0B59%40CH2PR14MB3913.namprd14.prod.outlook.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/CAEtntjUKJwusCdvPchr5NuyFThEwE0GtNFw05Fnrd9AAVa%3DkZQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAEtntjUKJwusCdvPchr5NuyFThEwE0GtNFw05Fnrd9AAVa%3DkZQ%40mail.gmail.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/CADWbU-jeFYMG2su9F%3DoAm7r1JNKkVVwoqhZ1itwMRHG_Uu0kfQ%40mail.gmail.com.

Reply via email to