class Pettanr.Finder extends Backbone.Collection initialize: (@action_manifest, @params) -> @return_model = Manifest.item_name_to_model @action_manifest.return_item_name parse: (res) -> @page_status = res.page_status res.list items: () -> _.map @models, (model) => item = new @return_model(model.attributes) Pettanr.cache.store(item) open: (context, options) -> @url = '/' + @action_manifest.url(@params) @fetch({ success: (collection, response, opt) => # @boost(items) options.success.call(context, @items()) error: (collection, response, opt) => options.fail.call(context, response, opt) }) to_filer: (context, options) -> @open(context, { success: (items) => pager = Locmare.ListGroupModule.LibModule.Pager.factory(@page_status, @params) filer = new Locmare.Filer({ item_name: @action_manifest.return_item_name, items: items, pager: pager }) options.success.call(context, filer) fail: (response, opt) => options.fail.call(context, response, opt) })