[ckan-dev] Why do related_list and related_show return values have a different format?
Daniel Graziotin
dgraziotin at task3.cc
Thu Mar 7 17:53:45 UTC 2013
Hi,
Is there a rationale on the different return value formats of libckan.logic.action.get.related_list and libckan.logic.action.get.related_show?
I've just noticed the following while developing libckan.
This is what libckan.logic.action.get.related_list of "test-bus-stop" in beta.ckan.org returns (one related item omitted)
{
u'view_count': 1,
u'description': u'This is Bands in Town, always related...',
u'created': u'2013-03-05T18:11:41.458691',
u'url': u'http://www.programmableweb.com/mashup/bandsintown',
u'title': u'Bands in Town',
u'featured': 0,
u'image_url': u'',
u'type': u'api',
u'id': u'537504c0-711a-4f17-9580-b0c130fdc1d4',
u'owner_id': u'd545a711-8fd4-4023-869e-815b86cd2002'
}
This is what libckan.logic.action.get.related_show of '537504c0-711a-4f17-9580-b0c130fdc1d4' (the previous item) returns:
{
u'__extras': {u'view_count': 1},
u'description': u'This is Bands in Town, always related...',
u'url': u'http://www.programmableweb.com/mashup/bandsintown',
u'title': u'Bands in Town',
u'featured': 0,
u'image_url': u'',
u'type': u'api',
u'id': u'537504c0-711a-4f17-9580-b0c130fdc1d4',
u'owner_id': u'd545a711-8fd4-4023-869e-815b86cd2002'
}
In the second case, 'view_count' is in the '__extras' field, while 'created' is missing.
Cheers,
--Daniel Graziotin
More information about the ckan-dev
mailing list