WuttaWeb 0.10.1__tar.gz → 0.10.2__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 (145) hide show
  1. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/CHANGELOG.md +7 -0
  2. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/PKG-INFO +1 -1
  3. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/pyproject.toml +1 -1
  4. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/forms/base.py +29 -6
  5. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/grids/base.py +26 -1
  6. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/form.mako +4 -5
  7. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/grids/vue_template.mako +1 -1
  8. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/master/index.mako +1 -4
  9. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/forms/test_base.py +6 -0
  10. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/grids/test_base.py +6 -0
  11. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/.gitignore +0 -0
  12. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/COPYING.txt +0 -0
  13. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/README.md +0 -0
  14. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/Makefile +0 -0
  15. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/_static/.keepme +0 -0
  16. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/index.rst +0 -0
  17. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/app.rst +0 -0
  18. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/auth.rst +0 -0
  19. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/db.rst +0 -0
  20. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/forms.base.rst +0 -0
  21. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/forms.rst +0 -0
  22. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/forms.schema.rst +0 -0
  23. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/forms.widgets.rst +0 -0
  24. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/grids.base.rst +0 -0
  25. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/grids.rst +0 -0
  26. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/handler.rst +0 -0
  27. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/helpers.rst +0 -0
  28. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/index.rst +0 -0
  29. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/menus.rst +0 -0
  30. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/static.rst +0 -0
  31. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/subscribers.rst +0 -0
  32. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/util.rst +0 -0
  33. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/views.auth.rst +0 -0
  34. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/views.base.rst +0 -0
  35. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/views.common.rst +0 -0
  36. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/views.essential.rst +0 -0
  37. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/views.master.rst +0 -0
  38. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/views.people.rst +0 -0
  39. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/views.roles.rst +0 -0
  40. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/views.rst +0 -0
  41. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/views.settings.rst +0 -0
  42. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/api/wuttaweb/views.users.rst +0 -0
  43. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/conf.py +0 -0
  44. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/glossary.rst +0 -0
  45. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/index.rst +0 -0
  46. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/make.bat +0 -0
  47. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/docs/narr/index.rst +0 -0
  48. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/__init__.py +0 -0
  49. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/_version.py +0 -0
  50. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/app.py +0 -0
  51. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/auth.py +0 -0
  52. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/db.py +0 -0
  53. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/forms/__init__.py +0 -0
  54. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/forms/schema.py +0 -0
  55. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/forms/widgets.py +0 -0
  56. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/grids/__init__.py +0 -0
  57. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/handler.py +0 -0
  58. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/helpers.py +0 -0
  59. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/menus.py +0 -0
  60. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/static/__init__.py +0 -0
  61. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/static/img/favicon.ico +0 -0
  62. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/static/img/logo.png +0 -0
  63. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/static/img/testing.png +0 -0
  64. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/subscribers.py +0 -0
  65. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/appinfo/configure.mako +0 -0
  66. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/appinfo/index.mako +0 -0
  67. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/auth/change_password.mako +0 -0
  68. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/auth/login.mako +0 -0
  69. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/base.mako +0 -0
  70. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/base_meta.mako +0 -0
  71. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/configure.mako +0 -0
  72. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/deform/checkbox.pt +0 -0
  73. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/deform/checkbox_choice.pt +0 -0
  74. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/deform/checked_password.pt +0 -0
  75. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/deform/password.pt +0 -0
  76. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/deform/permissions.pt +0 -0
  77. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/deform/readonly/notes.pt +0 -0
  78. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/deform/readonly/objectref.pt +0 -0
  79. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/deform/readonly/permissions.pt +0 -0
  80. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/deform/select.pt +0 -0
  81. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/deform/textarea.pt +0 -0
  82. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/deform/textinput.pt +0 -0
  83. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/forbidden.mako +0 -0
  84. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/forms/vue_template.mako +0 -0
  85. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/home.mako +0 -0
  86. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/master/configure.mako +0 -0
  87. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/master/create.mako +0 -0
  88. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/master/delete.mako +0 -0
  89. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/master/edit.mako +0 -0
  90. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/master/form.mako +0 -0
  91. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/master/view.mako +0 -0
  92. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/notfound.mako +0 -0
  93. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/page.mako +0 -0
  94. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/people/view_profile.mako +0 -0
  95. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/setup.mako +0 -0
  96. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/templates/wutta-components.mako +0 -0
  97. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/util.py +0 -0
  98. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/views/__init__.py +0 -0
  99. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/views/auth.py +0 -0
  100. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/views/base.py +0 -0
  101. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/views/common.py +0 -0
  102. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/views/essential.py +0 -0
  103. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/views/master.py +0 -0
  104. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/views/people.py +0 -0
  105. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/views/roles.py +0 -0
  106. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/views/settings.py +0 -0
  107. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/src/wuttaweb/views/users.py +0 -0
  108. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tasks.py +0 -0
  109. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/__init__.py +0 -0
  110. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/forms/__init__.py +0 -0
  111. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/forms/test_schema.py +0 -0
  112. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/forms/test_widgets.py +0 -0
  113. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/grids/__init__.py +0 -0
  114. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/bb_fontawesome_svg_core.js +0 -0
  115. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/bb_free_solid_svg_icons.js +0 -0
  116. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/bb_oruga.js +0 -0
  117. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/bb_oruga_bulma.css +0 -0
  118. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/bb_oruga_bulma.js +0 -0
  119. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/bb_vue.js +0 -0
  120. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/bb_vue_fontawesome.js +0 -0
  121. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/buefy.css +0 -0
  122. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/buefy.js +0 -0
  123. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/fontawesome.js +0 -0
  124. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/vue.js +0 -0
  125. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/libcache/vue_resource.js +0 -0
  126. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/test_app.py +0 -0
  127. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/test_auth.py +0 -0
  128. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/test_handler.py +0 -0
  129. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/test_helpers.py +0 -0
  130. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/test_menus.py +0 -0
  131. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/test_static.py +0 -0
  132. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/test_subscribers.py +0 -0
  133. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/test_util.py +0 -0
  134. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/util.py +0 -0
  135. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/views/__init__.py +0 -0
  136. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/views/test___init__.py +0 -0
  137. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/views/test_auth.py +0 -0
  138. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/views/test_base.py +0 -0
  139. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/views/test_common.py +0 -0
  140. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/views/test_master.py +0 -0
  141. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/views/test_people.py +0 -0
  142. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/views/test_roles.py +0 -0
  143. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/views/test_settings.py +0 -0
  144. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tests/views/test_users.py +0 -0
  145. {wuttaweb-0.10.1 → wuttaweb-0.10.2}/tox.ini +0 -0
@@ -5,6 +5,13 @@ All notable changes to wuttaweb will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## v0.10.2 (2024-08-19)
9
+
10
+ ### Fix
11
+
12
+ - add `render_vue_finalize()` methods for grids, forms
13
+ - avoid error when checking model for column property
14
+
8
15
  ## v0.10.1 (2024-08-19)
9
16
 
10
17
  ### Fix
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: WuttaWeb
3
- Version: 0.10.1
3
+ Version: 0.10.2
4
4
  Summary: Web App for Wutta Framework
5
5
  Project-URL: Homepage, https://wuttaproject.org/
6
6
  Project-URL: Repository, https://forgejo.wuttaproject.org/wutta/wuttaweb
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "WuttaWeb"
9
- version = "0.10.1"
9
+ version = "0.10.2"
10
10
  description = "Web App for Wutta Framework"
11
11
  readme = "README.md"
12
12
  authors = [{name = "Lance Edgar", email = "lance@edbob.org"}]
@@ -918,19 +918,42 @@ class Form:
918
918
 
919
919
  return HTML.tag('b-field', c=[html], **attrs)
920
920
 
921
+ def render_vue_finalize(self):
922
+ """
923
+ Render the Vue "finalize" script for the form.
924
+
925
+ By default this simply returns:
926
+
927
+ .. code-block:: html
928
+
929
+ <script>
930
+ WuttaForm.data = function() { return WuttaFormData }
931
+ Vue.component('wutta-form', WuttaForm)
932
+ </script>
933
+
934
+ The actual output may depend on various form attributes, in
935
+ particular :attr:`vue_tagname`.
936
+ """
937
+ set_data = f"{self.vue_component}.data = function() {{ return {self.vue_component}Data }}"
938
+ make_component = f"Vue.component('{self.vue_tagname}', {self.vue_component})"
939
+ return HTML.tag('script', c=['\n',
940
+ HTML.literal(set_data),
941
+ '\n',
942
+ HTML.literal(make_component),
943
+ '\n'])
944
+
921
945
  def get_vue_model_data(self):
922
946
  """
923
947
  Returns a dict with form model data. Values may be nested
924
948
  depending on the types of fields contained in the form.
925
949
 
926
- Note that the values need not be "converted" (to be
927
- JSON-compatible) at this stage, for instance ``colander.null``
928
- is not a problem here. The point is to collect the raw data.
950
+ This collects the ``cstruct`` values for all fields which are
951
+ present both in :attr:`fields` as well as the Deform schema.
929
952
 
930
- The dict should have a key/value for each field in the form.
953
+ It also converts each as needed, to ensure it is
954
+ JSON-serializable.
931
955
 
932
- This method is called by :meth:`render_vue_model_data()` which
933
- is responsible for ensuring JSON compatibility.
956
+ :returns: Dict of field/value items.
934
957
  """
935
958
  dform = self.get_deform()
936
959
  model_data = {}
@@ -578,7 +578,8 @@ class Grid:
578
578
  if key in sorters:
579
579
  continue
580
580
  prop = getattr(self.model_class, key, None)
581
- if prop and isinstance(prop.property, orm.ColumnProperty):
581
+ if (prop and hasattr(prop, 'property')
582
+ and isinstance(prop.property, orm.ColumnProperty)):
582
583
  sorters[prop.key] = self.make_sorter(prop)
583
584
 
584
585
  return sorters
@@ -1277,6 +1278,30 @@ class Grid:
1277
1278
  output = render(template, context)
1278
1279
  return HTML.literal(output)
1279
1280
 
1281
+ def render_vue_finalize(self):
1282
+ """
1283
+ Render the Vue "finalize" script for the grid.
1284
+
1285
+ By default this simply returns:
1286
+
1287
+ .. code-block:: html
1288
+
1289
+ <script>
1290
+ WuttaGrid.data = function() { return WuttaGridData }
1291
+ Vue.component('wutta-grid', WuttaGrid)
1292
+ </script>
1293
+
1294
+ The actual output may depend on various grid attributes, in
1295
+ particular :attr:`vue_tagname`.
1296
+ """
1297
+ set_data = f"{self.vue_component}.data = function() {{ return {self.vue_component}Data }}"
1298
+ make_component = f"Vue.component('{self.vue_tagname}', {self.vue_component})"
1299
+ return HTML.tag('script', c=['\n',
1300
+ HTML.literal(set_data),
1301
+ '\n',
1302
+ HTML.literal(make_component),
1303
+ '\n'])
1304
+
1280
1305
  def get_vue_columns(self):
1281
1306
  """
1282
1307
  Returns a list of Vue-compatible column definitions.
@@ -3,7 +3,9 @@
3
3
 
4
4
  <%def name="page_content()">
5
5
  <div style="margin-top: 2rem; width: 50%;">
6
- ${form.render_vue_tag()}
6
+ % if form is not Undefined:
7
+ ${form.render_vue_tag()}
8
+ % endif
7
9
  </div>
8
10
  </%def>
9
11
 
@@ -17,10 +19,7 @@
17
19
  <%def name="finalize_this_page_vars()">
18
20
  ${parent.finalize_this_page_vars()}
19
21
  % if form is not Undefined:
20
- <script>
21
- ${form.vue_component}.data = function() { return ${form.vue_component}Data }
22
- Vue.component('${form.vue_tagname}', ${form.vue_component})
23
- </script>
22
+ ${form.render_vue_finalize()}
24
23
  % endif
25
24
  </%def>
26
25
 
@@ -37,7 +37,7 @@
37
37
  ## paging
38
38
  % if grid.paginated:
39
39
  paginated
40
- pagination-size="is-small"
40
+ pagination-size="${'small' if request.use_oruga else 'is-small'}"
41
41
  :per-page="perPage"
42
42
  :current-page="currentPage"
43
43
  @page-change="onPageChange"
@@ -22,10 +22,7 @@
22
22
  <%def name="finalize_this_page_vars()">
23
23
  ${parent.finalize_this_page_vars()}
24
24
  % if grid is not Undefined:
25
- <script>
26
- ${grid.vue_component}.data = function() { return ${grid.vue_component}Data }
27
- Vue.component('${grid.vue_tagname}', ${grid.vue_component})
28
- </script>
25
+ ${grid.render_vue_finalize()}
29
26
  % endif
30
27
  </%def>
31
28
 
@@ -405,6 +405,12 @@ class TestForm(TestCase):
405
405
  self.assertIn('<script type="text/x-template" id="wutta-form-template">', html)
406
406
  self.assertNotIn('@submit', html)
407
407
 
408
+ def test_render_vue_finalize(self):
409
+ form = self.make_form()
410
+ html = form.render_vue_finalize()
411
+ self.assertIn('<script>', html)
412
+ self.assertIn("Vue.component('wutta-form', WuttaForm)", html)
413
+
408
414
  def test_render_vue_field(self):
409
415
  self.pyramid_config.include('pyramid_deform')
410
416
  schema = self.make_schema()
@@ -855,6 +855,12 @@ class TestGrid(WebTestCase):
855
855
  html = grid.render_vue_template()
856
856
  self.assertIn('<script type="text/x-template" id="wutta-grid-template">', html)
857
857
 
858
+ def test_render_vue_finalize(self):
859
+ grid = self.make_grid()
860
+ html = grid.render_vue_finalize()
861
+ self.assertIn('<script>', html)
862
+ self.assertIn("Vue.component('wutta-grid', WuttaGrid)", html)
863
+
858
864
  def test_get_vue_columns(self):
859
865
 
860
866
  # error if no columns are set
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes