Added checks in BaseTable data attributes lambda functions to handle contents without a name
--- a/src/pyams_skin/table.py Wed Mar 04 14:08:18 2015 +0100
+++ b/src/pyams_skin/table.py Wed Mar 04 14:09:12 2015 +0100
@@ -65,9 +65,9 @@
@property
def data_attributes(self):
- return {'tr': {'id': lambda x: '{0}::{1}'.format(self.id, x.__name__),
- 'data-ams-element-name': lambda x: x.__name__,
- 'data-ams-url': lambda x: getattr(get_element_editor(self, x), 'url', ''),
+ return {'tr': {'id': lambda x: '{0}::{1}'.format(self.id, getattr(x, '__name__', '')),
+ 'data-ams-element-name': lambda x: getattr(x, '__name__', None),
+ 'data-ams-url': lambda x: getattr(get_element_editor(self, x), 'url', None),
'data-toggle': lambda x: 'modal' if getattr(get_element_editor(self, x), 'modal_target', None) else None}}
batchSize = 10000