Updated sorted views merge modes
authorThierry Florac <thierry.florac@onf.fr>
Wed, 04 Jul 2018 17:17:57 +0200
changeset 798 754dcbb0ede9
parent 797 73ced1817195
child 799 dd66696cb871
Updated sorted views merge modes
src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo
src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po
src/pyams_content/locales/pyams_content.pot
src/pyams_content/shared/view/merge.py
Binary file src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo has changed
--- a/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po	Wed Jul 04 09:03:53 2018 +0200
+++ b/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po	Wed Jul 04 17:17:57 2018 +0200
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-07-03 14:21+0200\n"
+"POT-Creation-Date: 2018-07-04 17:10+0200\n"
 "PO-Revision-Date: 2015-09-10 10:42+0200\n"
 "Last-Translator: Thierry Florac <tflorac@ulthar.net>\n"
 "Language-Team: French\n"
@@ -1277,30 +1277,47 @@
 msgid "Presentation template used for this header"
 msgstr "Mode de rendu utilisé par ce chapô"
 
-#: src/pyams_content/component/theme/__init__.py:65
+#: src/pyams_content/component/theme/__init__.py:70
+#: src/pyams_content/component/theme/interfaces/__init__.py:47
+msgid "Tags"
+msgstr "Tags"
+
+#: src/pyams_content/component/theme/__init__.py:118
 #: src/pyams_content/component/theme/zmi/portlet.py:40
-#: src/pyams_content/component/theme/interfaces/__init__.py:43
+#: src/pyams_content/component/theme/interfaces/__init__.py:85
 msgid "Themes"
 msgstr "Thèmes"
 
-#: src/pyams_content/component/theme/__init__.py:74
+#: src/pyams_content/component/theme/__init__.py:79
+msgid "no defined tag"
+msgstr "aucun tag défini"
+
+#: src/pyams_content/component/theme/__init__.py:127
 msgid "no defined theme"
 msgstr "aucun thème défini"
 
-#: src/pyams_content/component/theme/zmi/__init__.py:51
+#: src/pyams_content/component/theme/zmi/__init__.py:60
 #: src/pyams_content/shared/view/zmi/theme.py:48
 msgid "Themes..."
 msgstr "Thèmes"
 
-#: src/pyams_content/component/theme/zmi/__init__.py:63
+#: src/pyams_content/component/theme/zmi/__init__.py:72
 msgid "Content themes"
 msgstr "Thèmes du contenu"
 
-#: src/pyams_content/component/theme/zmi/manager.py:45
+#: src/pyams_content/component/theme/zmi/manager.py:50
+msgid "Tags settings..."
+msgstr "Paramétrage des tags"
+
+#: src/pyams_content/component/theme/zmi/manager.py:64
+msgid "Selected tags"
+msgstr "Tags sélectionnés"
+
+#: src/pyams_content/component/theme/zmi/manager.py:97
 msgid "Themes settings..."
 msgstr "Paramétrage des thèmes"
 
-#: src/pyams_content/component/theme/zmi/manager.py:59
+#: src/pyams_content/component/theme/zmi/manager.py:111
 msgid "Selected themes"
 msgstr "Thèmes sélectionnés"
 
@@ -3490,39 +3507,39 @@
 msgid "News topic"
 msgstr "Actualité"
 
-#: src/pyams_content/shared/view/merge.py:60
+#: src/pyams_content/shared/view/merge.py:59
 msgid "Concatenate views items in order"
 msgstr "Concaténer les résultats de chaque vue dans l'ordre sélectionné"
 
-#: src/pyams_content/shared/view/merge.py:72
+#: src/pyams_content/shared/view/merge.py:71
 msgid "Extract items randomly"
 msgstr "Extraire les résultats en ordre aléatoire"
 
-#: src/pyams_content/shared/view/merge.py:86
+#: src/pyams_content/shared/view/merge.py:85
 msgid "Take items from views one by one, in views order"
 msgstr ""
 "Extraire les résultats de chaque vue, une par une (ordre des vues imposé)"
 
-#: src/pyams_content/shared/view/merge.py:99
+#: src/pyams_content/shared/view/merge.py:98
 msgid "Take items from views one by one, in random order"
 msgstr ""
 "Extraire les résultats de chaque vue, une par une (ordre des vues aléatoire)"
 
-#: src/pyams_content/shared/view/merge.py:128
+#: src/pyams_content/shared/view/merge.py:127
 msgid "Sort all results by creation date"
-msgstr "Trier tous les résultats sur la date de création"
-
-#: src/pyams_content/shared/view/merge.py:137
+msgstr "Trier tous les résultats sur la date de création (du plus récent au plus ancien)"
+
+#: src/pyams_content/shared/view/merge.py:136
 msgid "Sort all results by last update date"
-msgstr "Trier tous les résultats sur la date de dernière mise à jour"
-
-#: src/pyams_content/shared/view/merge.py:146
+msgstr "Trier tous les résultats sur la date de dernière mise à jour (du plus récent au plus ancien)"
+
+#: src/pyams_content/shared/view/merge.py:145
 msgid "Sort all results by current publication date"
-msgstr "Trier tous les résultats sur la date de publication"
-
-#: src/pyams_content/shared/view/merge.py:155
+msgstr "Trier tous les résultats sur la date de publication (du plus récent au plus ancien)"
+
+#: src/pyams_content/shared/view/merge.py:154
 msgid "Sort all results by first publication date"
-msgstr "Trier tous les résultats sur la date de première publication"
+msgstr "Trier tous les résultats sur la date de première publication (du plus récent au plus ancien)"
 
 #: src/pyams_content/shared/view/zmi/properties.py:40
 msgid "Main view settings"
@@ -3554,7 +3571,7 @@
 msgid "View internal references settings"
 msgstr "Références internes de la vue"
 
-#: src/pyams_content/shared/view/portlet/__init__.py:84
+#: src/pyams_content/shared/view/portlet/__init__.py:91
 msgid "View items"
 msgstr "Contenu d'une vue"
 
@@ -4193,7 +4210,7 @@
 msgid "Default length used for inner tables and dashboards"
 msgstr "Longueur par défaut des tableaux internes et des tableaux de bord"
 
-#: src/pyams_content/root/__init__.py:67
+#: src/pyams_content/root/__init__.py:68
 msgid "Site root"
 msgstr "Racine du site"
 
--- a/src/pyams_content/locales/pyams_content.pot	Wed Jul 04 09:03:53 2018 +0200
+++ b/src/pyams_content/locales/pyams_content.pot	Wed Jul 04 17:17:57 2018 +0200
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-07-03 14:21+0200\n"
+"POT-Creation-Date: 2018-07-04 17:10+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1226,30 +1226,47 @@
 msgid "Presentation template used for this header"
 msgstr ""
 
-#: ./src/pyams_content/component/theme/__init__.py:65
+#: ./src/pyams_content/component/theme/__init__.py:70
+#: ./src/pyams_content/component/theme/interfaces/__init__.py:47
+msgid "Tags"
+msgstr ""
+
+#: ./src/pyams_content/component/theme/__init__.py:118
 #: ./src/pyams_content/component/theme/zmi/portlet.py:40
-#: ./src/pyams_content/component/theme/interfaces/__init__.py:43
+#: ./src/pyams_content/component/theme/interfaces/__init__.py:85
 msgid "Themes"
 msgstr ""
 
-#: ./src/pyams_content/component/theme/__init__.py:74
+#: ./src/pyams_content/component/theme/__init__.py:79
+msgid "no defined tag"
+msgstr ""
+
+#: ./src/pyams_content/component/theme/__init__.py:127
 msgid "no defined theme"
 msgstr ""
 
-#: ./src/pyams_content/component/theme/zmi/__init__.py:51
+#: ./src/pyams_content/component/theme/zmi/__init__.py:60
 #: ./src/pyams_content/shared/view/zmi/theme.py:48
 msgid "Themes..."
 msgstr ""
 
-#: ./src/pyams_content/component/theme/zmi/__init__.py:63
+#: ./src/pyams_content/component/theme/zmi/__init__.py:72
 msgid "Content themes"
 msgstr ""
 
-#: ./src/pyams_content/component/theme/zmi/manager.py:45
+#: ./src/pyams_content/component/theme/zmi/manager.py:50
+msgid "Tags settings..."
+msgstr ""
+
+#: ./src/pyams_content/component/theme/zmi/manager.py:64
+msgid "Selected tags"
+msgstr ""
+
+#: ./src/pyams_content/component/theme/zmi/manager.py:97
 msgid "Themes settings..."
 msgstr ""
 
-#: ./src/pyams_content/component/theme/zmi/manager.py:59
+#: ./src/pyams_content/component/theme/zmi/manager.py:111
 msgid "Selected themes"
 msgstr ""
 
@@ -3275,35 +3292,35 @@
 msgid "News topic"
 msgstr ""
 
-#: ./src/pyams_content/shared/view/merge.py:60
+#: ./src/pyams_content/shared/view/merge.py:59
 msgid "Concatenate views items in order"
 msgstr ""
 
-#: ./src/pyams_content/shared/view/merge.py:72
+#: ./src/pyams_content/shared/view/merge.py:71
 msgid "Extract items randomly"
 msgstr ""
 
-#: ./src/pyams_content/shared/view/merge.py:86
+#: ./src/pyams_content/shared/view/merge.py:85
 msgid "Take items from views one by one, in views order"
 msgstr ""
 
-#: ./src/pyams_content/shared/view/merge.py:99
+#: ./src/pyams_content/shared/view/merge.py:98
 msgid "Take items from views one by one, in random order"
 msgstr ""
 
-#: ./src/pyams_content/shared/view/merge.py:128
+#: ./src/pyams_content/shared/view/merge.py:127
 msgid "Sort all results by creation date"
 msgstr ""
 
-#: ./src/pyams_content/shared/view/merge.py:137
+#: ./src/pyams_content/shared/view/merge.py:136
 msgid "Sort all results by last update date"
 msgstr ""
 
-#: ./src/pyams_content/shared/view/merge.py:146
+#: ./src/pyams_content/shared/view/merge.py:145
 msgid "Sort all results by current publication date"
 msgstr ""
 
-#: ./src/pyams_content/shared/view/merge.py:155
+#: ./src/pyams_content/shared/view/merge.py:154
 msgid "Sort all results by first publication date"
 msgstr ""
 
@@ -3337,7 +3354,7 @@
 msgid "View internal references settings"
 msgstr ""
 
-#: ./src/pyams_content/shared/view/portlet/__init__.py:84
+#: ./src/pyams_content/shared/view/portlet/__init__.py:91
 msgid "View items"
 msgstr ""
 
@@ -3939,7 +3956,7 @@
 msgid "Default length used for inner tables and dashboards"
 msgstr ""
 
-#: ./src/pyams_content/root/__init__.py:67
+#: ./src/pyams_content/root/__init__.py:68
 msgid "Site root"
 msgstr ""
 
--- a/src/pyams_content/shared/view/merge.py	Wed Jul 04 09:03:53 2018 +0200
+++ b/src/pyams_content/shared/view/merge.py	Wed Jul 04 17:17:57 2018 +0200
@@ -113,10 +113,9 @@
 
     @classmethod
     def get_results(cls, views, context, ignore_cache=False):
-        results = (view.get_results(context,
-                                    sort_index=cls.sort_index,
-                                    reverse=True,
-                                    ignore_cache=ignore_cache)
+        results = (sorted(view.get_results(context,
+                                           ignore_cache=ignore_cache),
+                          key=cls.sort_key, reverse=True)
                    for view in views)
         yield from merge(*results, key=cls.sort_key)