pyams-table 1.0.0__py3.5.egg → 1.0.1__py3.5.egg
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.
EGG-INFO/PKG-INFO
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyams-table
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: PyAMS management package for HTML tables
|
|
5
5
|
Home-page: https://pyams.readthedocs.io
|
|
6
6
|
Author: Thierry Florac
|
|
@@ -40,6 +40,10 @@ Description: ===================
|
|
|
40
40
|
Changelog
|
|
41
41
|
=========
|
|
42
42
|
|
|
43
|
+
1.0.1
|
|
44
|
+
-----
|
|
45
|
+
- use current request registry instead of global registry to query adapters
|
|
46
|
+
|
|
43
47
|
1.0.0
|
|
44
48
|
-----
|
|
45
49
|
- initial release
|
|
Binary file
|
|
Binary file
|
pyams_table/column.py
CHANGED
|
@@ -18,7 +18,6 @@ This module provides base classes and adapters for table columns management.
|
|
|
18
18
|
import html
|
|
19
19
|
from urllib.parse import urlencode
|
|
20
20
|
|
|
21
|
-
from zope.component import queryMultiAdapter
|
|
22
21
|
from zope.dublincore.interfaces import IZopeDublinCore
|
|
23
22
|
from zope.interface import implementer
|
|
24
23
|
from zope.location import Location
|
|
@@ -103,8 +102,9 @@ class Column(Location):
|
|
|
103
102
|
|
|
104
103
|
def render_head_cell(self):
|
|
105
104
|
"""Header cell content."""
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
registry = self.request.registry
|
|
106
|
+
header = registry.queryMultiAdapter((self.context, self.request, self.table, self),
|
|
107
|
+
IColumnHeader)
|
|
108
108
|
if header:
|
|
109
109
|
header.update()
|
|
110
110
|
# HTML escaping is the responsibility of IColumnHeader.render
|
pyams_table/table.py
CHANGED
|
@@ -17,7 +17,6 @@ This module provides the main table management class.
|
|
|
17
17
|
|
|
18
18
|
from xml.sax.saxutils import quoteattr
|
|
19
19
|
|
|
20
|
-
from zope.component import getAdapters, getMultiAdapter
|
|
21
20
|
from zope.interface import implementer
|
|
22
21
|
from zope.location import Location
|
|
23
22
|
|
|
@@ -107,7 +106,8 @@ class Table(Location):
|
|
|
107
106
|
@property
|
|
108
107
|
def values(self):
|
|
109
108
|
"""Get table values"""
|
|
110
|
-
|
|
109
|
+
registry = self.request.registry
|
|
110
|
+
adapter = registry.getMultiAdapter((self.context, self.request, self), IValues)
|
|
111
111
|
return adapter.values
|
|
112
112
|
|
|
113
113
|
# CSS helpers
|
|
@@ -147,7 +147,8 @@ class Table(Location):
|
|
|
147
147
|
|
|
148
148
|
def setup_columns(self):
|
|
149
149
|
"""Setup columns"""
|
|
150
|
-
|
|
150
|
+
registry = self.request.registry
|
|
151
|
+
cols = list(registry.getAdapters((self.context, self.request, self), IColumn))
|
|
151
152
|
# use the adapter name as column name
|
|
152
153
|
return [name_column(col, name) for name, col in cols]
|
|
153
154
|
|
|
@@ -240,9 +241,10 @@ class Table(Location):
|
|
|
240
241
|
def update_batch(self):
|
|
241
242
|
"""Update batch, if required"""
|
|
242
243
|
if IBatch.providedBy(self.rows):
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
registry = self.request.registry
|
|
245
|
+
self.batch_provider = registry.getMultiAdapter((self.context, self.request, self),
|
|
246
|
+
IBatchProvider,
|
|
247
|
+
name=self.batch_provider_name)
|
|
246
248
|
self.batch_provider.update()
|
|
247
249
|
|
|
248
250
|
def is_selected_row(self, row):
|