dossier/store/store.py
def _index_scan_prefix_impl(self, idx_name, val_prefix, retfunc):
        '''Implementation for index_scan_prefix and
        index_scan_prefix_and_return_key, parameterized on return
        value function.

        retfunc gets passed a key tuple from the index:
        (index name, index value, content_id)
        '''
        idx = self._index(idx_name)['transform']
        val_prefix = idx(val_prefix)

        idx_name = idx_name.encode('utf-8')
        s = (val_prefix, idx_name)
        e = (val_prefix + '\xff', idx_name)
        keys = self.kvl.scan_keys(self.INDEX_TABLE, (s, e))
        return imap(retfunc, keys)
def _index_scan_prefix_impl(self, idx_name, val_prefix, retfunc):
        '''Implementation for index_scan_prefix and
        index_scan_prefix_and_return_key, parameterized on return
        value function.

        retfunc gets passed a key tuple from the index:
        (index name, index value, content_id)
        '''
        idx = self._index(idx_name)['transform']
        val_prefix = idx(val_prefix)

        idx_name = idx_name.encode('utf-8')
        s = (val_prefix, idx_name)
        e = (val_prefix + '\xff', idx_name)
        keys = self.kvl.scan_keys(self.INDEX_TABLE, (s, e))
        return imap(retfunc, keys)
Implementation for index_scan_prefix and
        index_scan_prefix_and_return_key, parameterized on return
        value function.

        retfunc gets passed a key tuple from the index:
        (index name, index value, content_id)