On Friday, February 6, 2015 at 9:39:00 AM UTC-8, Henry Versemann wrote:
>
> Scot, Thanks for the reply. OK I've gotten down to the point to where I 
> have my version of your json_data in your code below, but I'm not sure I 
> understand exactly what your code is doing, after you have the json_data 
> variable contents. In my case the first object of response data that I'm 
> trying to use is a list of two items, with each item containing multiple 
> keys and internal or sub objects within them.
>

Once your data comes back from the API and has been converted to python 
data structures, it's up to you to parse and extract from it what you need 
- every situation is different. All you need to know is that you access 
list items by their index, and dictionary items by quoted key name. So if I 
assign the response object you show here to a variable "data", I can do the 
following:

print(data[0]['parameters'])
print(data[0]['parameters']['extra_text'])
print(data[1]['attachment']['display_name'])

and the result is:

{u'enrollment_term_id': u'', u'extra_text': u'Term: All Terms;'}
Term: All Terms;
grade_export_csv_22_Oct_2013_2_27551-0.csv

Hope this helps!

./s
 

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/428cc652-220e-44d8-8818-33725c0b141f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to