summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Lasudry <lasudry@gmail.com>2018-10-01 13:45:00 (GMT)
committerLaurent Lasudry <lasudry@gmail.com>2018-10-01 13:45:00 (GMT)
commit8ebb1172c57c62b64e9af40794ae23cd672edd60 (patch)
tree80810450f80544b15757510517604a987bc40d70
parentc1da50265ae43a9bc9c82fe49aabd6684dedf093 (diff)
downloadcollective.dms.thesaurus-8ebb1172c57c62b64e9af40794ae23cd672edd60.zip
collective.dms.thesaurus-8ebb1172c57c62b64e9af40794ae23cd672edd60.tar.gz
collective.dms.thesaurus-8ebb1172c57c62b64e9af40794ae23cd672edd60.tar.bz2
Avoid to wake up each and every thesaurus object
It's not needed as we only use id and title
-rw-r--r--CONTRIBUTORS.rst1
-rw-r--r--src/collective/dms/thesaurus/vocabulary.py3
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):