Avoid to wake up each and every thesaurus object

This commit is contained in:
Laurent Lasudry 2018-11-06 06:43:39 +01:00
parent 8ebb1172c5
commit 1ab7d86b8e
1 changed files with 1 additions and 3 deletions

View File

@ -63,10 +63,8 @@ class KeywordFromSameThesaurusSource(object):
catalog = getToolByName(context, 'portal_catalog')
results = catalog(portal_type='dmskeyword',
path={'query': thesaurus_path,'depth': 1})
keywords = [x.getObject() for x in results]
keyword_terms = [SimpleVocabulary.createTerm(
x.id, x.id, x.title) for x in keywords]
x.getId, x.getId, x.Title) for x in results]
return SimpleVocabulary(keyword_terms)
def __iter__(self):