Updated PyAMS_utils "unique" API
authorThierry Florac <thierry.florac@onf.fr>
Mon, 02 Jul 2018 08:59:17 +0200
changeset 70 1c28c3f6aa99
parent 69 c5dc7118d102
child 71 bfe52e72aa76
Updated PyAMS_utils "unique" API
src/pyams_thesaurus/rpc/json/__init__.py
--- a/src/pyams_thesaurus/rpc/json/__init__.py	Thu Jun 28 08:44:41 2018 +0200
+++ b/src/pyams_thesaurus/rpc/json/__init__.py	Mon Jul 02 08:59:17 2018 +0200
@@ -55,7 +55,7 @@
     return [{'id': term.label,
              'text': term.title}
             for term in unique(thesaurus.find_terms(query, extract_name, exact=True, stemmed=True),
-                               idfun=lambda x: x.title)
+                               key=lambda x: x.title)
                      if term.status != STATUS_ARCHIVED]
 
 
@@ -68,5 +68,5 @@
     return [{'id': term.label,
              'text': term.label}
             for term in unique(thesaurus.find_terms(query, extract_name, exact=True, stemmed=True),
-                               idfun=lambda x: x.label)
+                               key=lambda x: x.label)
                      if term.status != STATUS_ARCHIVED]