Add data type selection attribute to views
authorThierry Florac <thierry.florac@onf.fr>
Tue, 17 Jul 2018 18:02:12 +0200
changeset 77 43a9b140bc89
parent 76 d3c79177aef3
child 78 8bd665f8baab
Add data type selection attribute to views
src/pyams_content_es/shared/view/__init__.py
--- a/src/pyams_content_es/shared/view/__init__.py	Wed Jul 11 15:21:28 2018 +0200
+++ b/src/pyams_content_es/shared/view/__init__.py	Tue Jul 17 18:02:12 2018 +0200
@@ -48,6 +48,10 @@
         content_types = view.get_content_types(context)
         if content_types:
             params &= Q('terms', **{'content_type': content_types})
+        # check data types
+        data_types = view.get_data_types(context)
+        if data_types:
+            params &= Q('terms', **{'data_type': data_types})
         # check workflow states
         wf_params = []
         for workflow in registry.getAllUtilitiesRegisteredFor(IWorkflow):