Hi list!
I'm a problem with json and django. My javascript code send all data
by ajax but my view don't accept the content [Object Object] like json
object.
I try using jquery:
settings = {
model_name: 'Client',
cols: {"id": {"label":"", "width":"10px"}, "name":
{"label":"Nome", "width":"300px;"}}
}
$.ajax({
type: 'POST',
url: '/datagrid/',
dataType: 'json',
data: settings,
success: function(r) {
....
Django raise exception:
Exception Value: Expecting object: line 1 column 1 (char 1)
Exception Location: /usr/lib/python2.5/site-packages/django/utils/
simplejson/decoder.py in JSONArray, line 221
in my view I use:
def myview(request)
P = request.POST
cols = "%s" % simplejson.loads(P.get('cols'))
but the request's content is:
<QueryDict: {u'model_name': [u'Client'], u'cols': [u'[object Object]']}
>
Can you help me?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---