Hi, I'm using dojo (also tried with jquery) to send json data to my
django application.

But I can't get it working properly.

The problem is that my json data is manage as a dict key with an empty
string as value.

json data :
{"Home":{"Id":"1","Name":"home"},"Home2":{"Id":"3","Name":"Home2"}}
django request post :
<QueryDict: {u'{"Home":{"Id":"1","Name":"home"},"Home2":
{"Id":"3","Name":"Home2"}}': [u'']}>

The only way I found is to convert them into a python dictionnary is
to do this :
"""
    if request.method == 'POST':
        postlist = request.POST.keys()[0]
        json_data = json.JSONDecoder().decode(post)
"""

You can note that I need to take the keys()[0] to access the data.
It doesn't look right to me.

Do someone knows what I'm doing wrong ?

Thank you

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to