By default, when using django-tastypie and fetching a list of resources, the response has the format:
{ "meta": { "limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 3 }, "objects": [{ "body": "Welcome to my blog!", "id": "1", "pub_date": "2011-05-20T00:46:38", "resource_uri": "/api/v1/entry/1/", "slug": "first-post", "title": "First Post", "user": "/api/v1/user/1/" }, ... ] }
I delved into the documentation and looked and looked, but I can’t find any meta parameter or setting to change the “objects” key to actually describe the returned elements. For example, let's say I have a list of places in one api call and a list of people in another. I would like to distinguish a key from "locations" and "people". The real reason for this is that I am using RestKit for iOS and want to be able to establish multiple mappings.
source share