Web · Wiki · Activities · Blog · Lists · Chat · Meeting · Bugs · Git · Translate · Archive · People · Donate

Commit b0e6e213cb5179ff3c3cd1bb0f6d08dda4b1d5d3

Implement find_unique_values()

Previously it returned only a fixed set of values to satisfy the test suite.
  
315315
316316 def find_unique_values(self, query, name):
317317 logging.debug('find_unique_values(%r, %r)', query, name)
318 return ['org.sugarlabs.DataStoreTest1', 'org.sugarlabs.DataStoreTest2']
318 if query:
319 raise NotImplementedError('non-empty query not supported yet')
320
321 return self._index.find_unique_values(name)
319322
320323 def save(self, tree_id, parent_id, metadata, path, delete_after, async_cb,
321324 async_err_cb):
  
304304
305305 return entries, total_count
306306
307 def find_unique_values(self, property):
308 if property in _STANDARD_TERMS:
309 prefix = _PREFIX_FULL_VALUE + _STANDARD_TERMS[property]['prefix']
310 else:
311 prefix = _PREFIX_FULL_VALUE + _prefix_for_unknown(property)
312
313 return [term.term[len(prefix):]
314 for term in self._database.allterms(prefix)]
315
307316 def retrieve(self, object_id):
308317 postings = self._database.postlist(_object_id_term(object_id))
309318 document = self._database.get_document(postings.next().docid)