Avoid to wake up each and every thesaurus object

It's not needed as we only use id and title
This commit is contained in:
Laurent Lasudry 2018-10-01 15:45:00 +02:00
parent c1da50265a
commit 8ebb1172c5
2 changed files with 2 additions and 2 deletions

View File

@ -4,3 +4,4 @@
- Cédric Messiant, Ecreall
- Frédéric Peters, Entr'ouvert
- David Convent, Entr'ouvert
- Laurent Lasudry, Affinitic

View File

@ -32,9 +32,8 @@ class SimpleThesaurusSource(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):