WebGrid 0.5.8__tar.gz → 0.5.10__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 (86) hide show
  1. {WebGrid-0.5.8 → WebGrid-0.5.10}/PKG-INFO +21 -1
  2. {WebGrid-0.5.8 → WebGrid-0.5.10}/WebGrid.egg-info/PKG-INFO +21 -1
  3. {WebGrid-0.5.8 → WebGrid-0.5.10}/WebGrid.egg-info/requires.txt +1 -1
  4. {WebGrid-0.5.8 → WebGrid-0.5.10}/changelog.rst +20 -0
  5. {WebGrid-0.5.8 → WebGrid-0.5.10}/setup.py +1 -2
  6. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/extensions.py +7 -1
  7. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/renderers.py +1 -0
  8. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/testing.py +1 -1
  9. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/test_rendering.py +20 -0
  10. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/test_testing.py +7 -1
  11. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/test_unit.py +16 -0
  12. WebGrid-0.5.10/webgrid/version.py +1 -0
  13. WebGrid-0.5.8/webgrid/version.py +0 -1
  14. {WebGrid-0.5.8 → WebGrid-0.5.10}/MANIFEST.in +0 -0
  15. {WebGrid-0.5.8 → WebGrid-0.5.10}/WebGrid.egg-info/SOURCES.txt +0 -0
  16. {WebGrid-0.5.8 → WebGrid-0.5.10}/WebGrid.egg-info/dependency_links.txt +0 -0
  17. {WebGrid-0.5.8 → WebGrid-0.5.10}/WebGrid.egg-info/entry_points.txt +0 -0
  18. {WebGrid-0.5.8 → WebGrid-0.5.10}/WebGrid.egg-info/not-zip-safe +0 -0
  19. {WebGrid-0.5.8 → WebGrid-0.5.10}/WebGrid.egg-info/top_level.txt +0 -0
  20. {WebGrid-0.5.8 → WebGrid-0.5.10}/readme.rst +0 -0
  21. {WebGrid-0.5.8 → WebGrid-0.5.10}/setup.cfg +0 -0
  22. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/__init__.py +0 -0
  23. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/blazeweb.py +0 -0
  24. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/filters.py +0 -0
  25. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/flask.py +0 -0
  26. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/i18n/babel.cfg +0 -0
  27. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/i18n/es/LC_MESSAGES/webgrid.mo +0 -0
  28. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/i18n/es/LC_MESSAGES/webgrid.po +0 -0
  29. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/i18n/webgrid.pot +0 -0
  30. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/application_form_edit.png +0 -0
  31. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/b_firstpage.png +0 -0
  32. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/b_lastpage.png +0 -0
  33. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/b_nextpage.png +0 -0
  34. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/b_prevpage.png +0 -0
  35. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/bd_firstpage.png +0 -0
  36. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/bd_lastpage.png +0 -0
  37. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/bd_nextpage.png +0 -0
  38. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/bd_prevpage.png +0 -0
  39. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/delete.png +0 -0
  40. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/gettext.min.js +0 -0
  41. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/i18n/es/LC_MESSAGES/webgrid.json +0 -0
  42. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/jquery.multiple.select.js +0 -0
  43. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/multiple-select.css +0 -0
  44. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/multiple-select.png +0 -0
  45. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/th_arrow_down.png +0 -0
  46. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/th_arrow_up.png +0 -0
  47. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/webgrid.css +0 -0
  48. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/static/webgrid.js +0 -0
  49. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/templates/grid.html +0 -0
  50. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/templates/grid_footer.html +0 -0
  51. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/templates/grid_header.html +0 -0
  52. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/templates/grid_table.html +0 -0
  53. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/templates/header_filtering.html +0 -0
  54. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/templates/header_paging.html +0 -0
  55. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/templates/header_sorting.html +0 -0
  56. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/__init__.py +0 -0
  57. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/conftest.py +0 -0
  58. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/data/basic_table.html +0 -0
  59. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/data/people_table.html +0 -0
  60. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/data/stopwatch_table.html +0 -0
  61. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/helpers.py +0 -0
  62. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/test_api.py +0 -0
  63. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/test_columns.py +0 -0
  64. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/test_filters.py +0 -0
  65. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/tests/test_types.py +0 -0
  66. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/types.py +0 -0
  67. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/utils.py +0 -0
  68. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid/validators.py +0 -0
  69. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/__init__.py +0 -0
  70. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/app.py +0 -0
  71. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/data/basic_table.html +0 -0
  72. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/data/people_table.html +0 -0
  73. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/extensions.py +0 -0
  74. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/grids.py +0 -0
  75. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/helpers.py +0 -0
  76. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/i18n/babel.cfg +0 -0
  77. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/i18n/es/LC_MESSAGES/webgrid_ta.mo +0 -0
  78. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/i18n/es/LC_MESSAGES/webgrid_ta.po +0 -0
  79. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/i18n/webgrid_ta.pot +0 -0
  80. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/manage.py +0 -0
  81. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/model/__init__.py +0 -0
  82. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/model/entities.py +0 -0
  83. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/model/helpers.py +0 -0
  84. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/templates/groups.html +0 -0
  85. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/templates/index.html +0 -0
  86. {WebGrid-0.5.8 → WebGrid-0.5.10}/webgrid_ta/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: WebGrid
3
- Version: 0.5.8
3
+ Version: 0.5.10
4
4
  Summary: A library for rendering HTML tables and Excel files from SQLAlchemy models.
5
5
  Home-page: https://github.com/level12/webgrid
6
6
  Author: Randy Syring
@@ -88,6 +88,26 @@ Links
88
88
  Changelog
89
89
  =========
90
90
 
91
+ 0.5.10 released 2024-07-19
92
+ --------------------------
93
+
94
+ - ensure session override args replace arg lists (a7c61f6_)
95
+ - prevent session override from persisting in header form requests (cd1f7cd_)
96
+ - modernize tested python versions (3557f44_)
97
+
98
+ .. _a7c61f6: https://github.com/level12/webgrid/commit/a7c61f6
99
+ .. _cd1f7cd: https://github.com/level12/webgrid/commit/cd1f7cd
100
+ .. _3557f44: https://github.com/level12/webgrid/commit/3557f44
101
+
102
+
103
+ 0.5.9 released 2023-12-08
104
+ -------------------------
105
+
106
+ - ensure query string is applied for testing methods (3ccfb70_)
107
+
108
+ .. _3ccfb70: https://github.com/level12/webgrid/commit/3ccfb70
109
+
110
+
91
111
  0.5.8 released 2023-11-10
92
112
  -------------------------
93
113
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: WebGrid
3
- Version: 0.5.8
3
+ Version: 0.5.10
4
4
  Summary: A library for rendering HTML tables and Excel files from SQLAlchemy models.
5
5
  Home-page: https://github.com/level12/webgrid
6
6
  Author: Randy Syring
@@ -88,6 +88,26 @@ Links
88
88
  Changelog
89
89
  =========
90
90
 
91
+ 0.5.10 released 2024-07-19
92
+ --------------------------
93
+
94
+ - ensure session override args replace arg lists (a7c61f6_)
95
+ - prevent session override from persisting in header form requests (cd1f7cd_)
96
+ - modernize tested python versions (3557f44_)
97
+
98
+ .. _a7c61f6: https://github.com/level12/webgrid/commit/a7c61f6
99
+ .. _cd1f7cd: https://github.com/level12/webgrid/commit/cd1f7cd
100
+ .. _3557f44: https://github.com/level12/webgrid/commit/3557f44
101
+
102
+
103
+ 0.5.9 released 2023-12-08
104
+ -------------------------
105
+
106
+ - ensure query string is applied for testing methods (3ccfb70_)
107
+
108
+ .. _3ccfb70: https://github.com/level12/webgrid/commit/3ccfb70
109
+
110
+
91
111
  0.5.8 released 2023-11-10
92
112
  -------------------------
93
113
 
@@ -13,7 +13,7 @@ coverage
13
13
  mock
14
14
  openpyxl
15
15
  psycopg2-binary
16
- pyodbc==4.0.34
16
+ pyodbc
17
17
  pytest
18
18
  pytest-cov
19
19
  Flask
@@ -1,6 +1,26 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 0.5.10 released 2024-07-19
5
+ --------------------------
6
+
7
+ - ensure session override args replace arg lists (a7c61f6_)
8
+ - prevent session override from persisting in header form requests (cd1f7cd_)
9
+ - modernize tested python versions (3557f44_)
10
+
11
+ .. _a7c61f6: https://github.com/level12/webgrid/commit/a7c61f6
12
+ .. _cd1f7cd: https://github.com/level12/webgrid/commit/cd1f7cd
13
+ .. _3557f44: https://github.com/level12/webgrid/commit/3557f44
14
+
15
+
16
+ 0.5.9 released 2023-12-08
17
+ -------------------------
18
+
19
+ - ensure query string is applied for testing methods (3ccfb70_)
20
+
21
+ .. _3ccfb70: https://github.com/level12/webgrid/commit/3ccfb70
22
+
23
+
4
24
  0.5.8 released 2023-11-10
5
25
  -------------------------
6
26
 
@@ -14,8 +14,7 @@ develop_requires = [
14
14
  'mock',
15
15
  'openpyxl',
16
16
  'psycopg2-binary',
17
- # pinned to version in our package index.
18
- 'pyodbc==4.0.34',
17
+ 'pyodbc',
19
18
  'pytest',
20
19
  'pytest-cov',
21
20
  'Flask',
@@ -261,7 +261,13 @@ class WebSessionArgsLoader(ArgsLoader):
261
261
  is_override = 'session_override' in previous_args
262
262
 
263
263
  if is_override:
264
- session_args.update(previous_args)
264
+ # Typically we would want to just `.update()`, but args are MultiDict, so
265
+ # could have multiple values already. Previous args values are to be
266
+ # substituted, not treated as a list extension.
267
+ # Using copy, because if session_args and previous_args are the same
268
+ # object, we would be modifying the MultiDict in-place.
269
+ for key, value in previous_args.copy().lists():
270
+ session_args.setlist(key, value)
265
271
  else:
266
272
  # Some types of args always get passed through from request_args.
267
273
  # Override paging if it exists in the query
@@ -1164,6 +1164,7 @@ class HTML(GroupMixin, Renderer):
1164
1164
  url_args['v2({0})'.format(col.key)] = None
1165
1165
 
1166
1166
  url_args['session_key'] = self.grid.session_key
1167
+ url_args['session_override'] = None
1167
1168
  if session_reset:
1168
1169
  url_args['dgreset'] = 1
1169
1170
 
@@ -336,7 +336,7 @@ class GridBase:
336
336
  Returns:
337
337
  PyQuery object
338
338
  """
339
- session_grid = grid or self.get_session_grid(**kwargs)
339
+ session_grid = grid or self.get_session_grid(_query_string=_query_string, **kwargs)
340
340
  if session_grid.manager.request():
341
341
  # request context already exists
342
342
  html = session_grid.html()
@@ -12,6 +12,7 @@ import pytest
12
12
  import xlsxwriter
13
13
  from markupsafe import Markup
14
14
  from pyquery import PyQuery
15
+ from werkzeug.datastructures import MultiDict
15
16
 
16
17
  from webgrid import (
17
18
  BoolColumn,
@@ -367,6 +368,25 @@ class TestHtmlRenderer(object):
367
368
  == '/thepage?foo=bar&session_key={0}'.format(g.session_key)
368
369
  )
369
370
 
371
+ @_inrequest('/thepage?foo=bar&onpage=5&session_override=1')
372
+ def test_form_action_url_session_opts(self):
373
+ class TestManager(SimpleGrid.manager.__class__):
374
+ def get_args(self, previous_args):
375
+ return MultiDict(dict(foo='bar', onpage=5, session_override=1))
376
+
377
+ class TGrid(Grid):
378
+ manager = TestManager()
379
+
380
+ Column('ID', 'id')
381
+
382
+ g = TGrid()
383
+ g.set_records(self.key_data)
384
+ g.apply_qs_args()
385
+ assert (
386
+ g.html.form_action_url()
387
+ == '/thepage?foo=bar&session_key={0}'.format(g.session_key)
388
+ )
389
+
370
390
  @_inrequest('/thepage?foo=bar&onpage=5')
371
391
  def test_form_action_method_get(self):
372
392
  g = self.get_grid()
@@ -46,7 +46,7 @@ class TestAssertListEqual:
46
46
 
47
47
 
48
48
  class TestAssertRenderedXlsxMatches:
49
- def setup(self):
49
+ def setup_method(self):
50
50
  self.stream = BytesIO()
51
51
  self.workbook = xlsxwriter.Workbook(self.stream, options={'in_memory': True})
52
52
  self.sheet = self.workbook.add_worksheet('sheet1')
@@ -192,6 +192,12 @@ class TestGridBase(testing.GridBase):
192
192
  self.expect_table_header((('Created', 'Due Date', 'Start Time'), ))
193
193
  self.expect_table_contents((('01/01/2018 05:30 AM', '05/31/2019', '01:30 AM'), ))
194
194
 
195
+ def test_query_string_applied(self):
196
+ self.expect_table_contents(
197
+ (tuple()),
198
+ _query_string='op(due_date)=gte&v1(due_date)=2019-06-01',
199
+ )
200
+
195
201
 
196
202
  class TestGridBasePG(testing.GridBase):
197
203
  grid_cls = TemporalGrid
@@ -1218,6 +1218,22 @@ class TestWebSessionArgsLoader:
1218
1218
  assert args['op(createdts)'] == '!eq'
1219
1219
  assert args['v1(createdts)'] == '2017-05-06'
1220
1220
 
1221
+ @_inrequest('/foo?op(account_type)=is&v1(account_type)=admin')
1222
+ def test_keyed_session_with_override_multifilter(self):
1223
+ pg = PeopleGrid()
1224
+ loader = WebSessionArgsLoader(pg.manager)
1225
+ loader.get_args(pg, flask.request.args)
1226
+ flask.request.args = MultiDict([
1227
+ ('session_key', pg.session_key),
1228
+ ('session_override', 1),
1229
+ ('op(account_type)', 'is'),
1230
+ ('v1(account_type)', 'manager'),
1231
+ ])
1232
+ pg2 = PeopleGrid()
1233
+ args = loader.get_args(pg2, flask.request.args)
1234
+ assert args['op(account_type)'] == 'is'
1235
+ assert args.getlist('v1(account_type)') == ['manager']
1236
+
1221
1237
  @_inrequest('/foo?op(firstname)=eq&v1(firstname)=bob&perpage=1&onpage=100')
1222
1238
  def test_keyed_session_without_override(self):
1223
1239
  pg = PeopleGrid()
@@ -0,0 +1 @@
1
+ VERSION = '0.5.10'
@@ -1 +0,0 @@
1
- VERSION = '0.5.8'
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