On Feb 9, 2:19 pm, rokson <[email protected]> wrote:
> This is rokson a new django programmer struggling with the problem of
> how to get the json array values in my django views.py file.

???

> actually i am writing an opensocial which is going to deploy in the
> appengine using django framework.
>
> i am making ajax request in my app
>  gadgets.io.makeRequest(url,function(data),params);

Where does this come from, and where's the doc ? or are we supposed to
guess ?

ok, I cheated and guessed:
http://wiki.opensocial.org/index.php?title=Gadgets.io_(v0.8)#gadgets.io.makeRequest

but please bear in mind that very few of us have mind-reading
superpowers.



> here request will come to  appengine then it will come to urls.py in
> django and then it will come to one of my function of views.py
>
> here how to get the json array (here it is params) values in to my
> function.

"the json array", as you say, is only a "json array" (in this case:
some javascript object) in the javascript code that issues the
request. From the server-side POV, it's an ordinary HTTP request.
Given the FineManual(tm) for gadgets.io.RequestParameters (http://
wiki.opensocial.org/index.php?
title=Gadgets.io_(v0.8)#gadgets.io.RequestParameters), you'll find
most of these values in the request object (first param of your
Django's view function). A side-by-side reading of both docs - the one
for gadgets.io.RequestParameters and the one for Django's HTTPRequest
object - should tell you most of what you need to know.

As a side note, I very strongly suggest you take time to read about
the HTTP protocol. I know the relevant RFC is nothing sexy, but this
still will save you quite a lot of time and pain and frustration.

HTH

-- 
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.

Reply via email to