Thanks for your time Kasper, I've learnt something new from your message 
and I solved the problem yesterday itself it was my mistake I added the 
wrong model to serializer

On Sunday, 5 June 2022 at 23:15:47 UTC+5:30 Kasper Laudrup wrote:

> On 05/06/2022 07.06, Koushik Romel wrote:
> > I want those #One and #Two to be in curly braces {} and not as square 
> > bracket [] , and Thanks in advance
>
> A good start would be to understand what the difference between square 
> brackets and curly braces is. The JSON format is very simple:
>
> https://en.wikipedia.org/wiki/JSON#Syntax
>
> So you actually want to convert your array to an object with anonymous 
> properties/members. That doesn't really make any sense and wouldn't be 
> valid JSON.
>
> Of course you could write a dirty hack and do it anyway but I seriously 
> doubt that's really what you want.
>
> Hope that helps.
>
> Kind regards,
>
> Kasper Laudrup
>

-- 
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/c817ab9d-1243-4c1c-8433-4581698a4681n%40googlegroups.com.

Reply via email to