Hi,<div>You are right, we have deactivated any dehydrate process on any of the resource base apis in order to keep them fast. </div><div><br></div><div>You could create you own maps API endpoint though and have the map list to use it. <span></span></div><div><br>Il giovedì 25 agosto 2016, Craig Stephenson <<a href="mailto:crstephenson@alaska.edu">crstephenson@alaska.edu</a>> ha scritto:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi All,</div><div><br></div><div>I'm working on a project that uses GeoNode's API system. I've already had some success adding/modifying existing endpoints, but I've hit a snag. I'm hoping somebody can help point me in the right direction.</div><div><br></div><div>I want to include each map's keywords in the results of the following API endpoint:</div><div><br></div><div>/api/maps</div><div><br></div><div>I've found that the API results for a specific map (e.g., /api/maps/3) can be customized by adding a dehydrate function to the MapResource class in the geonode/api/resourcebase_api.<wbr>py file. For example, the keyword list can be added to the results like this:</div><div><br></div><div>class MapResource(CommonModelApi):</div><div> ...</div><div> def dehydrate(self, bundle):</div><div> map_id = bundle.data['id']</div><div> mapObj = Map.objects.filter(id=map_id)[<wbr>0]</div><div> bundle.data['keyword_list'] = mapObj.keyword_list()</div><div> return bundle</div><div><br></div><div>But this dehydrate function does not get invoked when you access the entire map list at /api/maps. How can I add data to the results for each map on the /api/maps endpoint?</div><div><br></div><div>Thank you!</div><div>Craig</div></div>
</blockquote></div><br><br>-- <br>Simone <br>