grid: custom representation of None value

This commit is contained in:
zvolsky
2016-06-06 12:25:06 +02:00
parent 154073c3a6
commit 0c52f2a561
+4 -1
View File
@@ -2041,7 +2041,8 @@ class SQLFORM(FORM):
client_side_delete=False,
ignore_common_filters=None,
auto_pagination=True,
use_cursor=False):
use_cursor=False,
represent_none=None):
formstyle = formstyle or current.response.formstyle
if isinstance(query, Set):
@@ -2789,6 +2790,8 @@ class SQLFORM(FORM):
value = truncate_string(value, maxlength)
elif not isinstance(value, XmlComponent):
value = field.formatter(value)
if value is None:
value = represent_none
trcols.append(TD(value))
row_buttons = TD(_class='row_buttons', _nowrap=True)
if links and links_in_grid: