boundlessgeo/gsconfig — pull request #39 by mwengren (2013-09-18 18:57:58+00:00)
Title: Improve the way Catalog.get_resource() and Store.get_resources() return single resource when workspace and store are known 

From clients such as GeoNode, resources can be obtained more efficiently by passing the resource name, store name, and workspace name to the Catalog.get_resource() method.

This patch adds an extra case to handle this within Catalog.get_resource(), and adds an extra 'name' parameter to both DataStore.get_resources() and CoverageStore.get_resources() that returns only a single resource matching name passed (if available) or None otherwise.

This can speed up performance of 'updatelayers' command in GeoNode significantly if a store contains a large number or resources. Previously, every resource in a store was returned in a list by DataStore.get_resources() / CoverageStore.get_resources(), where the calling method would then need to iterate through to find a name match. Prevents many unnecessary REST API calls.