Added themes indexes
authorThierry Florac <thierry.florac@onf.fr>
Mon, 11 Jun 2018 14:56:05 +0200
changeset 610 0e082a47ccd3
parent 609 375ab52043d6
child 611 a41421d75755
Added themes indexes
src/pyams_content/generations/__init__.py
--- a/src/pyams_content/generations/__init__.py	Mon Jun 11 14:43:21 2018 +0200
+++ b/src/pyams_content/generations/__init__.py	Mon Jun 11 14:56:05 2018 +0200
@@ -9,6 +9,8 @@
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
+from pyams_content.component.theme import IThemesInfo
+from pyams_thesaurus.index import ThesaurusTermsListFieldIndex
 
 __docformat__ = 'restructuredtext'
 
@@ -111,7 +113,19 @@
                                                      'resolution': MINUTE_RESOLUTION}),
     ('first_publication_date', DatetimeIndexWithInterface, {'interface': IWorkflowPublicationInfo,
                                                             'discriminator': 'first_publication_date',
-                                                            'resolution': MINUTE_RESOLUTION})
+                                                            'resolution': MINUTE_RESOLUTION}),
+    ('themes', ThesaurusTermsListFieldIndex, {'interface': IThemesInfo,
+                                              'discriminator': 'themes',
+                                              'include_parents': False,
+                                              'include_synonyms': False}),
+    ('themes_tree', ThesaurusTermsListFieldIndex, {'interface': IThemesInfo,
+                                                   'discriminator': 'themes',
+                                                   'include_parents': True,
+                                                   'include_synonyms': False}),
+    ('themes_all', ThesaurusTermsListFieldIndex, {'interface': IThemesInfo,
+                                                  'discriminator': 'themes',
+                                                  'include_parents': True,
+                                                  'include_synonyms': True})
 ]