collective.documentgenerator 3.48__tar.gz → 3.50__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/CHANGES.rst +20 -0
  2. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/MANIFEST.in +1 -0
  3. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/PKG-INFO +21 -1
  4. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/setup.py +1 -1
  5. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/configure.zcml +27 -0
  6. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/resources/css/documentgenerator.css +20 -3
  7. collective_documentgenerator-3.50/src/collective/documentgenerator/browser/sub_templates_usage.pt +25 -0
  8. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/table.py +123 -0
  9. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/templates_listing.pt +2 -2
  10. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/views.py +16 -2
  11. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/pod_template.py +14 -9
  12. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/vocabulary.py +11 -1
  13. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/vocabulary.zcml +8 -0
  14. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/locales/collective.documentgenerator.pot +5 -1
  15. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/locales/es/LC_MESSAGES/collective.documentgenerator.po +11 -2
  16. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/locales/fr/LC_MESSAGES/collective.documentgenerator.po +11 -2
  17. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_base_helper_view.py +1 -1
  18. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_configurable_pod_template.py +32 -1
  19. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_generation_view.py +3 -3
  20. collective_documentgenerator-3.50/src/collective/documentgenerator/tests/test_sub_templates_usage_view.py +165 -0
  21. collective_documentgenerator-3.50/src/collective/documentgenerator/tests/test_viewlets.py +69 -0
  22. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_vocabulary.py +19 -0
  23. collective_documentgenerator-3.50/src/collective/documentgenerator/viewlets/sub_template_usage.pt +11 -0
  24. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/viewlets/sub_template_usage.py +13 -0
  25. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective.documentgenerator.egg-info/PKG-INFO +21 -1
  26. collective_documentgenerator-3.48/src/collective/documentgenerator/browser/sub_templates_usage.pt +0 -62
  27. collective_documentgenerator-3.48/src/collective/documentgenerator/tests/test_sub_templates_usage_view.py +0 -51
  28. collective_documentgenerator-3.48/src/collective/documentgenerator/tests/test_viewlets.py +0 -29
  29. collective_documentgenerator-3.48/src/collective/documentgenerator/viewlets/sub_template_usage.pt +0 -32
  30. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/.coveragerc +0 -0
  31. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/.isort.cfg +0 -0
  32. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/.tx/config +0 -0
  33. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/Makefile +0 -0
  34. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/README.rst +0 -0
  35. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/buildout.cfg +0 -0
  36. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/docs/LICENSE.GPL +0 -0
  37. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/docs/LICENSE.rst +0 -0
  38. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/docs/developer.rst +0 -0
  39. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/docs/images/AddPODTTemplateMenu.png +0 -0
  40. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/docs/images/addPloneSite.png +0 -0
  41. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/docs/images/demoInstal.png +0 -0
  42. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/docs/images/documentgenerator-searchreplacepanel.png +0 -0
  43. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/docs/images/viewlet.png +0 -0
  44. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/docs/search_replace.rst +0 -0
  45. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/docs/technical.rst +0 -0
  46. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/docs/user.rst +0 -0
  47. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/setup.cfg +0 -0
  48. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/__init__.py +0 -0
  49. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/AT_renderer.py +0 -0
  50. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/DX_renderer.py +0 -0
  51. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/__init__.py +0 -0
  52. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/adapters.py +0 -0
  53. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/__init__.py +0 -0
  54. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/actionspanel.py +0 -0
  55. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/check_pod_templates.pt +0 -0
  56. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/children_pod_template.pt +0 -0
  57. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/controlpanel.py +0 -0
  58. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/converter.py +0 -0
  59. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/generation_view.py +0 -0
  60. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/overrides.py +0 -0
  61. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/.gitkeep +0 -0
  62. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/configurable.svg +0 -0
  63. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/csv.svg +0 -0
  64. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/doc.svg +0 -0
  65. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/docx.svg +0 -0
  66. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/download_icon.svg +0 -0
  67. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/libreoffice-blanck.svg +0 -0
  68. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/mailinglooptemplate.svg +0 -0
  69. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/missing_use.svg +0 -0
  70. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/nok.svg +0 -0
  71. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/nok_use.svg +0 -0
  72. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/nok_used.svg +0 -0
  73. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/odp.svg +0 -0
  74. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/ods.svg +0 -0
  75. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/odt.svg +0 -0
  76. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/ok.svg +0 -0
  77. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/ok_use.svg +0 -0
  78. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/ok_used.svg +0 -0
  79. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/pdf.svg +0 -0
  80. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/podtemplate.svg +0 -0
  81. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/rtf.svg +0 -0
  82. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/style.svg +0 -0
  83. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/subtemplate.svg +0 -0
  84. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/xls.svg +0 -0
  85. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/browser/static/xlsx.svg +0 -0
  86. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/config.py +0 -0
  87. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/configure.zcml +0 -0
  88. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/__init__.py +0 -0
  89. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/condition.py +0 -0
  90. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/conditions.zcml +0 -0
  91. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/configure.zcml +0 -0
  92. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/document_factory.py +0 -0
  93. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/file_representation.py +0 -0
  94. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/file_representation.zcml +0 -0
  95. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/merge_templates.py +0 -0
  96. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/merge_templates.zcml +0 -0
  97. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/content/style_template.py +0 -0
  98. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/demo/__init__.py +0 -0
  99. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/demo/archetypes.zcml +0 -0
  100. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/demo/configure.zcml +0 -0
  101. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/demo/helper.py +0 -0
  102. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/events/__init__.py +0 -0
  103. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/events/configure.zcml +0 -0
  104. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/events/pod_templates_events.py +0 -0
  105. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/events/styles_events.py +0 -0
  106. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/helper/__init__.py +0 -0
  107. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/helper/archetypes-adapter.zcml +0 -0
  108. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/helper/archetypes-page.zcml +0 -0
  109. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/helper/archetypes.py +0 -0
  110. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/helper/base.py +0 -0
  111. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/helper/configure.zcml +0 -0
  112. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/helper/dexterity.py +0 -0
  113. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/interfaces.py +0 -0
  114. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/locales/es/LC_MESSAGES/plone.po +0 -0
  115. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/locales/fr/LC_MESSAGES/plone.po +0 -0
  116. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/locales/manual.pot +0 -0
  117. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/locales/plone-manual.pot +0 -0
  118. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/locales/plone.pot +0 -0
  119. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/locales/update.sh +0 -0
  120. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/migrations/__init__.py +0 -0
  121. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/migrations/migrate_to_11.py +0 -0
  122. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/migrations/migrate_to_12.py +0 -0
  123. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/migrations/migrate_to_13.py +0 -0
  124. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/migrations/migrate_to_16.py +0 -0
  125. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/migrations/migrate_to_3.py +0 -0
  126. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/migrations/migrate_to_5.py +0 -0
  127. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/migrations/migrate_to_6.py +0 -0
  128. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/migrations/migrate_to_7.py +0 -0
  129. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/migrations/migrate_to_8.py +0 -0
  130. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/migrations/migrate_to_9.py +0 -0
  131. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/base/browserlayer.xml +0 -0
  132. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/base/controlpanel.xml +0 -0
  133. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/base/metadata.xml +0 -0
  134. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/base/types/ConfigurablePODTemplate.xml +0 -0
  135. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/base/types/MailingLoopTemplate.xml +0 -0
  136. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/base/types/PODTemplate.xml +0 -0
  137. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/base/types/StyleTemplate.xml +0 -0
  138. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/base/types/SubTemplate.xml +0 -0
  139. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/base/types.xml +0 -0
  140. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/base/viewlets.xml +0 -0
  141. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/browserlayer.xml +0 -0
  142. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/collectivedocumentgenerator_demo_marker.txt +0 -0
  143. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/import_steps.xml +0 -0
  144. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/metadata.xml +0 -0
  145. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/registry.xml +0 -0
  146. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/templates/mailing.odt +0 -0
  147. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/templates/modele_general.ods +0 -0
  148. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/templates/modele_general.odt +0 -0
  149. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/templates/mod/303/250le_collection.odt" +0 -0
  150. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/templates/possibly_mailed_model.odt +0 -0
  151. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/templates/styles.odt +0 -0
  152. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/templates/styles_2.odt +0 -0
  153. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/templates/sub_template.odt +0 -0
  154. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/demo/viewlets.xml +0 -0
  155. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/plone4/collectivedocumentgenerator_marker.txt +0 -0
  156. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/plone4/cssregistry.xml +0 -0
  157. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/plone4/metadata.xml +0 -0
  158. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/plone4/registry.xml +0 -0
  159. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/plone5/metadata.xml +0 -0
  160. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/plone5/registry.xml +0 -0
  161. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/testing/metadata.xml +0 -0
  162. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/testing/propertiestool.xml +0 -0
  163. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/testing/types/member.xml +0 -0
  164. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles/testing/types.xml +0 -0
  165. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/profiles.zcml +0 -0
  166. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/renderer.zcml +0 -0
  167. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/search_replace/__init__.py +0 -0
  168. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/search_replace/configure.zcml +0 -0
  169. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/search_replace/pod_template.py +0 -0
  170. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/search_replace/search_result_form.pt +0 -0
  171. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/search_replace/searchreplace_panel.pt +0 -0
  172. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/search_replace/searchreplace_panel.py +0 -0
  173. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/setuphandlers.py +0 -0
  174. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/testing.py +0 -0
  175. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/testing.zcml +0 -0
  176. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/__init__.py +0 -0
  177. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/failing_template.odt +0 -0
  178. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/robot/.gitkeep +0 -0
  179. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/template_to_clean.odt +0 -0
  180. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/template_without_style_page.odt +0 -0
  181. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_AT_helper_view.py +0 -0
  182. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_DX_helper_view.py +0 -0
  183. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_check_podtemplates_view.py +0 -0
  184. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_config.py +0 -0
  185. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_demo_profile.py +0 -0
  186. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_events.py +0 -0
  187. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_file.odt +0 -0
  188. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_mailing.odt +0 -0
  189. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_mailing_loop_template.py +0 -0
  190. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_pod_template.py +0 -0
  191. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_robot.py +0 -0
  192. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_search_replace.py +0 -0
  193. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_setup.py +0 -0
  194. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_style_template.py +0 -0
  195. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_sub_template.py +0 -0
  196. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_templates_listing_view.py +0 -0
  197. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/tests/test_utils.py +0 -0
  198. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/utils.py +0 -0
  199. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/viewlets/__init__.py +0 -0
  200. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/viewlets/batchactions.py +0 -0
  201. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/viewlets/configure.zcml +0 -0
  202. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/viewlets/generationlinks.pt +0 -0
  203. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective/documentgenerator/viewlets/generationlinks.py +0 -0
  204. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective.documentgenerator.egg-info/SOURCES.txt +0 -0
  205. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective.documentgenerator.egg-info/dependency_links.txt +0 -0
  206. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective.documentgenerator.egg-info/entry_points.txt +0 -0
  207. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective.documentgenerator.egg-info/namespace_packages.txt +0 -0
  208. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective.documentgenerator.egg-info/not-zip-safe +0 -0
  209. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective.documentgenerator.egg-info/requires.txt +0 -0
  210. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/src/collective.documentgenerator.egg-info/top_level.txt +0 -0
  211. {collective_documentgenerator-3.48 → collective_documentgenerator-3.50}/test-ci.cfg +0 -0
@@ -1,6 +1,26 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 3.50 (2026-11-16)
5
+ -----------------
6
+
7
+ - Removed the duplicated "no value" option of the `style_template` field. (MOD-1080)
8
+ [chris-adam]
9
+ - Converted sub-templates usage view and viewlet to z3c.table and displayed the merge variable name. (PARAF-512)
10
+ [chris-adam,sgeulette]
11
+
12
+ 3.49 (2026-07-31)
13
+ -----------------
14
+
15
+ - Improved POD context variables to handle Python structures (list, tuple, dict).
16
+ BREAKING CHANGE: A context variable `1` is given to the template as the
17
+ integer `1` and no longer as the string `'1'` (same for `1.5` giving a float and `None`
18
+ giving `None`). Surround such a value with double quotes (`"1"`) to keep it a string.
19
+ Invalid Python literal values (plain text, `2026-01-01`, ...) are still kept as a string.
20
+ (MOD-1077)
21
+ [chris-adam]
22
+
23
+
4
24
  3.48 (2026-06-10)
5
25
  -----------------
6
26
 
@@ -10,6 +10,7 @@ exclude .installed.cfg
10
10
  exclude .mr.developer.cfg
11
11
  exclude buildout.d
12
12
  exclude requirements.txt
13
+ exclude src/collective/documentgenerator/locales/rebuild_i18n.log
13
14
  recursive-exclude buildout.d *.cfg
14
15
  recursive-include docs *.GPL
15
16
  recursive-include docs *.png
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: collective.documentgenerator
3
- Version: 3.48
3
+ Version: 3.50
4
4
  Summary: Desktop document generation (.odt, .pdf, .doc, ...) based on appy framework (https://appyframe.work/tool/public) and OpenOffice/LibreOffice
5
5
  Home-page: https://pypi.org/project/collective.documentgenerator
6
6
  Author: Simon Delcourt
@@ -229,6 +229,26 @@ The project is licensed under the GPLv2.
229
229
  Changelog
230
230
  =========
231
231
 
232
+ 3.50 (2026-11-16)
233
+ -----------------
234
+
235
+ - Removed the duplicated "no value" option of the `style_template` field. (MOD-1080)
236
+ [chris-adam]
237
+ - Converted sub-templates usage view and viewlet to z3c.table and displayed the merge variable name. (PARAF-512)
238
+ [chris-adam,sgeulette]
239
+
240
+ 3.49 (2026-07-31)
241
+ -----------------
242
+
243
+ - Improved POD context variables to handle Python structures (list, tuple, dict).
244
+ BREAKING CHANGE: A context variable `1` is given to the template as the
245
+ integer `1` and no longer as the string `'1'` (same for `1.5` giving a float and `None`
246
+ giving `None`). Surround such a value with double quotes (`"1"`) to keep it a string.
247
+ Invalid Python literal values (plain text, `2026-01-01`, ...) are still kept as a string.
248
+ (MOD-1077)
249
+ [chris-adam]
250
+
251
+
232
252
  3.48 (2026-06-10)
233
253
  -----------------
234
254
 
@@ -11,7 +11,7 @@ long_description = (
11
11
 
12
12
  setup(
13
13
  name='collective.documentgenerator',
14
- version='3.48',
14
+ version='3.50',
15
15
  description="Desktop document generation (.odt, .pdf, .doc, ...) based on appy framework (https://appyframe.work/tool/public) and OpenOffice/LibreOffice",
16
16
  long_description=long_description,
17
17
  # Get more from https://pypi.org/pypi?%3Aaction=list_classifiers
@@ -198,6 +198,33 @@
198
198
  factory=".table.DownloadColumn"
199
199
  />
200
200
 
201
+ <adapter
202
+ name="SubTemplateColumn"
203
+ for="zope.interface.Interface
204
+ zope.interface.Interface
205
+ .table.SubTemplatesUsageTable"
206
+ provides="z3c.table.interfaces.IColumn"
207
+ factory=".table.SubTemplateColumn"
208
+ />
209
+
210
+ <adapter
211
+ name="SubTemplateUsagePathColumn"
212
+ for="zope.interface.Interface
213
+ zope.interface.Interface
214
+ .table.SubTemplatesUsageTable"
215
+ provides="z3c.table.interfaces.IColumn"
216
+ factory=".table.SubTemplateUsagePathColumn"
217
+ />
218
+
219
+ <adapter
220
+ name="SubTemplateUsageTemplatesColumn"
221
+ for="zope.interface.Interface
222
+ zope.interface.Interface
223
+ .table.SubTemplatesUsageTable"
224
+ provides="z3c.table.interfaces.IColumn"
225
+ factory=".table.SubTemplateUsageTemplatesColumn"
226
+ />
227
+
201
228
  <!-- batchactions -->
202
229
  <browser:viewlet
203
230
  zcml:condition="installed collective.eeafaceted.batchactions"
@@ -20,16 +20,16 @@ div#doc-generation-view {
20
20
  line-height: 1.1em !important;
21
21
  }
22
22
 
23
- .template-dg-templates-listing #dg-batch {
23
+ .template-dg-templates-listing .dg-batch {
24
24
  padding-bottom: 0.15em;
25
25
  }
26
26
 
27
- .template-dg-templates-listing #dg-batch a {
27
+ .template-dg-templates-listing .dg-batch a {
28
28
  border: 1px solid #CCCCCC !important;
29
29
  padding: 0.15em;
30
30
  }
31
31
 
32
- .template-dg-templates-listing #dg-batch a.current{
32
+ .template-dg-templates-listing .dg-batch a.current{
33
33
  border: 0px !important;
34
34
  }
35
35
 
@@ -131,3 +131,20 @@ span.template-link-before-link img {
131
131
  margin:3px;
132
132
  vertical-align: middle;
133
133
  }
134
+
135
+ /* sub-templates usage: the merge variable, below the sub-template name */
136
+ .sub-templates-usage .pod-context-name {
137
+ color: #8d8d8d;
138
+ font-size: 90%;
139
+ }
140
+
141
+ /* the using templates disagree on the variable name */
142
+ .sub-templates-usage td.conflicting-variables {
143
+ background-color: #B3004B;
144
+ }
145
+
146
+ .sub-templates-usage td.conflicting-variables,
147
+ .sub-templates-usage td.conflicting-variables a,
148
+ .sub-templates-usage td.conflicting-variables .pod-context-name {
149
+ color: #fff;
150
+ }
@@ -0,0 +1,25 @@
1
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
2
+ xmlns:tal="http://xml.zope.org/namespaces/tal"
3
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
4
+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
5
+ lang="en"
6
+ metal:use-macro="context/main_template/macros/master"
7
+ i18n:domain="collective.documentgenerator">
8
+ <body>
9
+
10
+ <metal:main fill-slot="main">
11
+
12
+ <h1 class="documentFirstHeading" i18n:translate="sub_templates_usage_title">Sub-templates usages</h1>
13
+
14
+ <div id="content-core">
15
+ <tal:block define="results view/table/values" tal:condition="results">
16
+ <div class="dg-batch"><tal:batch replace="structure view/table/renderBatch" /></div>
17
+ <tal:listing replace="structure view/table/render" />
18
+ <div class="dg-batch"><tal:batch replace="structure view/table/renderBatch" /></div>
19
+ </tal:block>
20
+ </div>
21
+
22
+ </metal:main>
23
+
24
+ </body>
25
+ </html>
@@ -275,3 +275,126 @@ class DownloadColumn(NoEscapeLinkColumn):
275
275
  safe_unicode(translate(PMF('Download'), context=self.request)),
276
276
  u'%s/++resource++collective.documentgenerator/download_icon.svg' % self.table.portal_url)
277
277
  return down_img
278
+
279
+
280
+ class SubTemplatesUsageTable(Table):
281
+ """Table that displays sub-templates and the templates using them."""
282
+
283
+ cssClassEven = u'even'
284
+ cssClassOdd = u'odd'
285
+ cssClasses = {'table': 'listing nosort sub-templates-usage'}
286
+
287
+ batchSize = 200
288
+ startBatchingAt = 200
289
+ sortOn = None
290
+ results = []
291
+
292
+ @CachedProperty
293
+ def values(self):
294
+ return self.results
295
+
296
+ def getCSSHighlightClass(self, column, item, cssClass):
297
+ """Flag the sub-template cell when its using templates disagree on the variable name."""
298
+ if isinstance(column, SubTemplateColumn) and len(item['pod_context_names']) > 1:
299
+ return u'{0} conflicting-variables'.format(cssClass or u'').strip()
300
+ return cssClass
301
+
302
+
303
+ class SubTemplateUsageTable(SubTemplatesUsageTable):
304
+ """Usage table variant for the viewlet, where the sub-template is the context."""
305
+
306
+ hidden_columns = ('SubTemplateColumn', )
307
+
308
+ def setUpColumns(self):
309
+ columns = super(SubTemplateUsageTable, self).setUpColumns()
310
+ return [col for col in columns if col.__name__ not in self.hidden_columns]
311
+
312
+
313
+ class SubTemplateColumn(Column):
314
+ """Column that displays the sub-template and the variable it is merged under."""
315
+
316
+ header = _(u'sub_template_usage_sub_template', default=u'Sub-template')
317
+ weight = 10
318
+ cssClasses = {'td': 'sub-template-column'}
319
+
320
+ def render_sub_template(self, item):
321
+ """Return the cell content for the sub-template of `item`, without its variable."""
322
+ brain = item['sub_template']
323
+ link = u'<a href="{0}">{1}</a>'.format(brain.getURL(), escape(safe_unicode(brain.Title)))
324
+ if item['rel_path']:
325
+ return u'<span>{0}</span> / {1}'.format(escape(item['rel_path']), link)
326
+ return link
327
+
328
+ def renderCell(self, item):
329
+ if not item['first']:
330
+ return u''
331
+ cell = self.render_sub_template(item)
332
+ names = item['pod_context_names']
333
+ if names:
334
+ cell += u'<div class="pod-context-name">{0}</div>'.format(escape(u', '.join(names)))
335
+ return cell
336
+
337
+
338
+ class SubTemplateUsagePathColumn(Column):
339
+ """Column that displays the path of the templates using the sub-template."""
340
+
341
+ header = _(u'sub_template_usage_path', default=u'Path')
342
+ weight = 20
343
+ cssClasses = {'td': 'usage-path-column'}
344
+
345
+ def renderCell(self, item):
346
+ if item['group'] is None:
347
+ return u'-'
348
+ return escape(safe_unicode(item['group']['title_path']))
349
+
350
+
351
+ class SubTemplateUsageTemplatesColumn(Column):
352
+ """Column that displays the templates using the sub-template."""
353
+
354
+ header = _(u'sub_template_usage_templates', default=u'Using templates')
355
+ weight = 30
356
+ cssClasses = {'td': 'using-templates-column'}
357
+
358
+ def renderCell(self, item):
359
+ if item['group'] is None:
360
+ return u'<em>{0}</em>'.format(translate(
361
+ _(u'sub_template_usage_not_used', default=u'not used'), context=self.request))
362
+ return u'<ul>{0}</ul>'.format(u''.join(
363
+ u'<li><a href="{0}">{1}</a></li>'.format(tmpl.absolute_url(), escape(safe_unicode(tmpl.Title())))
364
+ for tmpl in item['group']['templates']))
365
+
366
+
367
+ def get_pod_context_names(sub_template_uid, groups):
368
+ """Return the distinct variable names the sub-template is merged under by the templates of `groups`.
369
+
370
+ More than one name means the using templates disagree on the variable name.
371
+ """
372
+ names = []
373
+ for group in groups or []:
374
+ for template in group['templates']:
375
+ for line in getattr(template, 'merge_templates', None) or []:
376
+ if line.get('template') != sub_template_uid:
377
+ continue
378
+ name = line.get('pod_context_name') or u''
379
+ if name and name not in names:
380
+ names.append(name)
381
+ return names
382
+
383
+
384
+ def get_sub_template_usage_rows(entries):
385
+ """Return the usage table rows for `entries`, one per (sub-template, path group).
386
+
387
+ A row carries the entry keys plus 'group' (None when the sub-template is used by no
388
+ template) and 'first' (False on a group continuation row, where the sub-template cell
389
+ stays empty since z3c.table has no rowspan). 'groups' is kept on every row so that a
390
+ cell can look at the whole sub-template, not only at its own group. 'pod_context_names'
391
+ is computed once per sub-template and shared by its rows.
392
+ """
393
+ rows = []
394
+ for entry in entries:
395
+ names = get_pod_context_names(entry['sub_template_uid'], entry['groups'])
396
+ for i, group in enumerate(entry['groups'] or [None]):
397
+ rows.append({'sub_template': entry['sub_template'], 'rel_path': entry['rel_path'],
398
+ 'sub_template_uid': entry['sub_template_uid'], 'group': group,
399
+ 'groups': entry['groups'], 'first': i == 0, 'pod_context_names': names})
400
+ return rows
@@ -14,9 +14,9 @@
14
14
  i18n:translate="sub_templates_usage_link">Sub-templates usage</a>
15
15
 
16
16
  <tal:block define="results view/table/values;" tal:condition="results">
17
- <div id="dg-batch"><tal:batch replace="structure view/table/renderBatch" /></div>
17
+ <div class="dg-batch"><tal:batch replace="structure view/table/renderBatch" /></div>
18
18
  <tal:listing replace="structure view/table/render" />
19
- <div id="dg-batch"><tal:batch replace="structure view/table/renderBatch" /></div>
19
+ <div class="dg-batch"><tal:batch replace="structure view/table/renderBatch" /></div>
20
20
  </tal:block>
21
21
 
22
22
  </metal:content-core>
@@ -2,6 +2,8 @@
2
2
  from Acquisition import aq_inner
3
3
  from Acquisition import aq_parent
4
4
  from collections import OrderedDict
5
+ from collective.documentgenerator.browser.table import get_sub_template_usage_rows
6
+ from collective.documentgenerator.browser.table import SubTemplatesUsageTable
5
7
  from collective.documentgenerator.browser.table import TemplatesTable
6
8
  from collective.documentgenerator.content.pod_template import IPODTemplate
7
9
  from collective.documentgenerator.content.pod_template import MailingLoopTemplate
@@ -106,6 +108,8 @@ class SubTemplatesUsage(BrowserView):
106
108
  """Overview listing, for each sub-template, the POD templates that use
107
109
  it in their 'merge_templates' field, grouped by the path they live in."""
108
110
 
111
+ __table__ = SubTemplatesUsageTable
112
+
109
113
  def sub_templates_usage(self):
110
114
  """Return a list of {'sub_template': brain, 'rel_path': unicode, 'groups': [...]}
111
115
  entries, one per sub-template (including unused ones), ordered by the
@@ -120,8 +124,8 @@ class SubTemplatesUsage(BrowserView):
120
124
  segments = get_path_segments(aq_parent(aq_inner(sub_template)))
121
125
  all_segments.append(segments)
122
126
  templates = get_pod_templates_using(sub_template)
123
- result.append({"sub_template": brain, "segments": segments,
124
- "groups": group_templates_by_path(templates)})
127
+ result.append({"sub_template": brain, "sub_template_uid": brain.UID,
128
+ "segments": segments, "groups": group_templates_by_path(templates)})
125
129
  common = common_prefix_length([[seg[0] for seg in segs] for segs in all_segments])
126
130
  for entry in result:
127
131
  tail = entry.pop("segments")[common:]
@@ -130,6 +134,16 @@ class SubTemplatesUsage(BrowserView):
130
134
  safe_unicode(e["sub_template"].Title).lower()))
131
135
  return result
132
136
 
137
+ def update(self):
138
+ self.table = self.__table__(self.context, self.request)
139
+ self.table.__name__ = u"sub-templates-usage"
140
+ self.table.results = get_sub_template_usage_rows(self.sub_templates_usage())
141
+ self.table.update()
142
+
143
+ def __call__(self):
144
+ self.update()
145
+ return self.index()
146
+
133
147
 
134
148
  class DisplayChildrenPodTemplateProvider(ContentProviderBase):
135
149
  template = ViewPageTemplateFile("children_pod_template.pt")
@@ -36,6 +36,7 @@ from zope.interface import Invalid
36
36
  from zope.interface import invariant
37
37
  from zope.interface import provider
38
38
 
39
+ import ast
39
40
  import copy
40
41
  import logging
41
42
 
@@ -311,7 +312,10 @@ class IConfigurablePODTemplate(IPODTemplate):
311
312
  form.widget('context_variables', DataGridFieldFactory)
312
313
  context_variables = schema.List(
313
314
  title=_(u'Context variables.'),
314
- description=_("These context variables are added to the odt_file context."),
315
+ description=_("These context variables are added to the odt_file context. A value that is a valid "
316
+ "python literal (True, False, None, 1, [1, 2], (1, 2), {'a': 1}) is converted to it, "
317
+ "any other value is kept as a string. Surround a value with double quotes to keep it "
318
+ "as a string."),
315
319
  required=False,
316
320
  value_type=DictRow(
317
321
  schema=IContextVariablesRowSchema,
@@ -454,18 +458,19 @@ class ConfigurablePODTemplate(PODTemplate):
454
458
 
455
459
  def get_context_variables(self):
456
460
  """
457
- Returns context_variables as dict
461
+ Returns context_variables as dict.
462
+ A value that is a valid python literal (True, False, None, 1, 1.5, [1, 2], (1, 2), {'a': 1})
463
+ is converted to it, any other value is kept as a string.
464
+ Surrounding a value with double quotes keeps it as a string ("1" gives '1').
458
465
  """
459
466
  ret = {}
460
467
  for line in self.context_variables or []:
461
- # Simple boolean conversion actually implemented
462
- # May be improved with ZPublisher.Converters, managing boolean, int, date, string, text, ...
463
- # Those last values in a list box with string as default value
464
468
  val = line['value']
465
- if val == 'True':
466
- val = True
467
- elif val == 'False':
468
- val = False
469
+ if val:
470
+ try:
471
+ val = ast.literal_eval(val)
472
+ except (SyntaxError, TypeError, ValueError):
473
+ pass # not a python literal, keep the original string
469
474
  ret[line['name']] = val
470
475
  return ret
471
476
 
@@ -10,6 +10,7 @@ from collective.documentgenerator.content.pod_template import IPODTemplate
10
10
  from collective.documentgenerator.utils import get_site_root_relative_path
11
11
  from plone import api
12
12
  from Products.CMFPlone.utils import safe_unicode
13
+ from z3c.form.converter import CollectionSequenceDataConverter
13
14
  from z3c.form.i18n import MessageFactory as _z3c_form
14
15
  from z3c.form.interfaces import IContextAware
15
16
  from z3c.form.interfaces import IDataManager
@@ -53,7 +54,7 @@ class StyleTemplatesVocabularyFactory(object):
53
54
  def __call__(self, context):
54
55
  catalog = api.portal.get_tool('portal_catalog')
55
56
  style_template_brains = catalog(portal_type='StyleTemplate')
56
- voc_terms = [SimpleTerm('--NOVALUE--', '--NOVALUE--', _z3c_form('No value'))]
57
+ voc_terms = []
57
58
 
58
59
  for brain in style_template_brains:
59
60
  voc_terms.append(SimpleTerm(brain.UID,
@@ -313,3 +314,12 @@ class ConfigStreamVocabularyFactory(object):
313
314
  ]
314
315
 
315
316
  return SimpleVocabulary(voc_terms)
317
+
318
+
319
+ class NoValueCollectionDataConverter(CollectionSequenceDataConverter):
320
+ """Empties a collection field when the widget 'no value' option is submitted."""
321
+
322
+ def toFieldValue(self, value):
323
+ if not value or value[0] == self.widget.noValueToken:
324
+ return self.field.missing_value
325
+ return super(NoValueCollectionDataConverter, self).toFieldValue(value)
@@ -87,6 +87,14 @@
87
87
  factory=".vocabulary.PTMCTV"
88
88
  />
89
89
 
90
+ <!-- 'No value' option of a select widget on a list field -->
91
+ <adapter
92
+ factory=".vocabulary.NoValueCollectionDataConverter"
93
+ for="zope.schema.interfaces.IList
94
+ z3c.form.interfaces.ISelectWidget"
95
+ provides="z3c.form.interfaces.IDataConverter"
96
+ />
97
+
90
98
  <!-- CSV field delimiter Vocabulary -->
91
99
  <utility
92
100
  factory=".vocabulary.CSVFieldDelimiterFactory"
@@ -483,7 +483,11 @@ msgid "The replacements that will be made."
483
483
  msgstr ""
484
484
 
485
485
  #: ../content/pod_template.py:314
486
- msgid "These context variables are added to the odt_file context."
486
+ msgid ""
487
+ "These context variables are added to the odt_file context. A value that is a "
488
+ "valid python literal (True, False, None, 1, [1, 2], (1, 2), {'a': 1}) is "
489
+ "converted to it, any other value is kept as a string. Surround a value with "
490
+ "double quotes to keep it as a string."
487
491
  msgstr ""
488
492
 
489
493
  #: ../browser/check_pod_templates.pt:30
@@ -490,8 +490,17 @@ msgid "The replacements that will be made."
490
490
  msgstr ""
491
491
 
492
492
  #: ../content/pod_template.py:314
493
- msgid "These context variables are added to the odt_file context."
494
- msgstr "Esas variables de contexto son añadidas al contexto del odt_file o plantilla Open Document."
493
+ msgid ""
494
+ "These context variables are added to the odt_file context. A value that is a "
495
+ "valid python literal (True, False, None, 1, [1, 2], (1, 2), {'a': 1}) is "
496
+ "converted to it, any other value is kept as a string. Surround a value with "
497
+ "double quotes to keep it as a string."
498
+ msgstr ""
499
+ "Esas variables de contexto son añadidas al contexto del odt_file o plantilla "
500
+ "Open Document. Un valor que es un literal de python válido (True, False, "
501
+ "None, 1, [1, 2], (1, 2), {'a': 1}) se convierte en este, cualquier otro "
502
+ "valor se conserva como cadena de texto. Rodee un valor con comillas dobles "
503
+ "para conservarlo como cadena de texto."
495
504
 
496
505
  #: ../browser/check_pod_templates.pt:30
497
506
  msgid "Used object"
@@ -484,8 +484,17 @@ msgid "The replacements that will be made."
484
484
  msgstr "Les remplacements qui vont être effectués."
485
485
 
486
486
  #: ../content/pod_template.py:314
487
- msgid "These context variables are added to the odt_file context."
488
- msgstr "Ces variables sont ajoutées au contexte passé au modèle odt."
487
+ msgid ""
488
+ "These context variables are added to the odt_file context. A value that is a "
489
+ "valid python literal (True, False, None, 1, [1, 2], (1, 2), {'a': 1}) is "
490
+ "converted to it, any other value is kept as a string. Surround a value with "
491
+ "double quotes to keep it as a string."
492
+ msgstr ""
493
+ "Ces variables sont ajoutées au contexte passé au modèle odt. Une valeur qui "
494
+ "est un littéral python valide (True, False, None, 1, [1, 2], (1, 2), {'a': "
495
+ "1}) est convertie en celui-ci, toute autre valeur est conservée comme chaîne "
496
+ "de caractères. Entourez une valeur de guillemets doubles pour la conserver "
497
+ "comme chaîne de caractères."
489
498
 
490
499
  #: ../browser/check_pod_templates.pt:30
491
500
  msgid "Used object"
@@ -70,7 +70,7 @@ class TestBaseHelperViewMethods(DexterityIntegrationTests):
70
70
  generation_context = view._get_generation_context(helper_view, pod_template=pod_template)
71
71
  renderer = appy.pod.renderer.Renderer(StringIO(document_template.data), generation_context, 'dummy.odt')
72
72
  helper_view._set_appy_renderer(renderer)
73
- self.assertEqual(helper_view.context_var('dexter', 'undefined'), u'1')
73
+ self.assertEqual(helper_view.context_var('dexter', 'undefined'), 1)
74
74
 
75
75
  def test_display_phone(self):
76
76
  # belgian phone numbers
@@ -214,7 +214,38 @@ class TestConfigurablePODTemplateIntegration(ConfigurablePODTemplateIntegrationT
214
214
  self.assertEqual(self.test_podtemplate.get_available_formats(), self.test_podtemplate.pod_formats)
215
215
 
216
216
  def test_get_context_variables(self):
217
- self.assertDictEqual(self.test_podtemplate.get_context_variables(), {'details': '1'})
217
+ self.assertDictEqual(self.test_podtemplate.get_context_variables(), {'details': 1})
218
+ # every valid python literal is converted to it
219
+ self.test_podtemplate.context_variables = [
220
+ {'name': u'a_true', 'value': u'True'},
221
+ {'name': u'a_false', 'value': u'False'},
222
+ {'name': u'a_none', 'value': u'None'},
223
+ {'name': u'an_int', 'value': u'1'},
224
+ {'name': u'a_float', 'value': u'1.5'},
225
+ {'name': u'a_list', 'value': u"['a', 'b']"},
226
+ {'name': u'a_tuple', 'value': u"('a', 'b')"},
227
+ {'name': u'a_dict', 'value': u"{'a': 1}"},
228
+ ]
229
+ self.assertDictEqual(
230
+ self.test_podtemplate.get_context_variables(),
231
+ {u'a_true': True, u'a_false': False, u'a_none': None, u'an_int': 1, u'a_float': 1.5,
232
+ u'a_list': ['a', 'b'], u'a_tuple': ('a', 'b'), u'a_dict': {'a': 1}})
233
+ # anything that is not a python literal is kept as a string,
234
+ # extra double quotes force a literal looking value to stay a string
235
+ self.test_podtemplate.context_variables = [
236
+ {'name': u'text', 'value': u'hello'},
237
+ {'name': u'date', 'value': u'2026-01-01'},
238
+ {'name': u'expr', 'value': u'1+1'},
239
+ {'name': u'quoted_int', 'value': u'"1"'},
240
+ {'name': u'empty', 'value': u''},
241
+ {'name': u'nothing', 'value': None},
242
+ {'name': u'a_set', 'value': u'{1, 2}'},
243
+ {'name': u'empty_set', 'value': u'set()'},
244
+ ]
245
+ self.assertDictEqual(
246
+ self.test_podtemplate.get_context_variables(),
247
+ {u'text': u'hello', u'date': u'2026-01-01', u'expr': u'1+1', u'quoted_int': u'1',
248
+ u'empty': u'', u'nothing': None, u'a_set': u'{1, 2}', u'empty_set': u'set()'})
218
249
 
219
250
  def test_validate_context_variables(self):
220
251
  class Dummy(object):
@@ -225,7 +225,7 @@ class TestGenerationViewMethods(PODTemplateIntegrationTest):
225
225
  hpv = view.get_generation_context_helper()
226
226
  # Check context variables
227
227
  self.assertDictEqual(view._get_generation_context(hpv, pod_template),
228
- {'details': '1',
228
+ {'details': 1,
229
229
  'portal': self.portal,
230
230
  'context': hpv.context,
231
231
  'view': hpv})
@@ -375,7 +375,7 @@ class TestGenerationViewMethods(PODTemplateIntegrationTest):
375
375
  gen_context = generation_view._get_generation_context(generation_view.get_generation_context_helper(),
376
376
  pod_template)
377
377
  self.assertIn('details', gen_context)
378
- self.assertEqual(gen_context['details'], '1')
378
+ self.assertEqual(gen_context['details'], 1)
379
379
 
380
380
  # the mailing loop view is called on the folder context !
381
381
  generation_view = folder.restrictedTraverse('@@mailing-loop-persistent-document-generation')
@@ -410,7 +410,7 @@ class TestGenerationViewMethods(PODTemplateIntegrationTest):
410
410
  gen_context = generation_view._get_generation_context(generation_view.get_generation_context_helper(),
411
411
  generation_view.pod_template)
412
412
  self.assertIn('details', gen_context)
413
- self.assertEqual(gen_context['details'], '1')
413
+ self.assertEqual(gen_context['details'], 1)
414
414
 
415
415
  def test_table_column_modifier(self):
416
416
  """ """