From 8ebb1172c57c62b64e9af40794ae23cd672edd60 Mon Sep 17 00:00:00 2001 From: Laurent Lasudry Date: Mon, 1 Oct 2018 15:45:00 +0200 Subject: [PATCH] Avoid to wake up each and every thesaurus object It's not needed as we only use id and title --- CONTRIBUTORS.rst | 1 + src/collective/dms/thesaurus/vocabulary.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 70befee..6758563 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -4,3 +4,4 @@ - Cédric Messiant, Ecreall - Frédéric Peters, Entr'ouvert - David Convent, Entr'ouvert +- Laurent Lasudry, Affinitic diff --git a/src/collective/dms/thesaurus/vocabulary.py b/src/collective/dms/thesaurus/vocabulary.py index 62e6ab3..3dd3380 100644 --- a/src/collective/dms/thesaurus/vocabulary.py +++ b/src/collective/dms/thesaurus/vocabulary.py @@ -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):