From 5afa8326843fb544724b34dcca95c9931ce34de6 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 2 Aug 2017 12:04:32 -0500 Subject: [PATCH] Add 'data-uuid' attr for mobile grid list items, if applicable --- tailbone/grids/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tailbone/grids/core.py b/tailbone/grids/core.py index fbe50bb9..6026714d 100644 --- a/tailbone/grids/core.py +++ b/tailbone/grids/core.py @@ -964,7 +964,10 @@ class CustomWebhelpersGrid(webhelpers2_grid.Grid): value = self.get_column_value(column_number, i, record, column_name) if self.mobile: url = self.url_generator(record, i) - return HTML.tag('li', tags.link_to(value, url)) + attrs = {} + if hasattr(record, 'uuid'): + attrs['data_uuid'] = record.uuid + return HTML.tag('li', tags.link_to(value, url), **attrs) if self.linked_columns and column_name in self.linked_columns: url = self.url_generator(record, i) value = tags.link_to(value, url)