fixed 'Return object from represent method of field'
This commit is contained in:
+2
-2
@@ -1206,7 +1206,7 @@ class SQLFORM(FORM):
|
|||||||
else:
|
else:
|
||||||
inp = field.formatter(default)
|
inp = field.formatter(default)
|
||||||
if getattr(field, 'show_if', None):
|
if getattr(field, 'show_if', None):
|
||||||
if not isinstance(inp, DIV):
|
if not isinstance(inp, XmlComponent):
|
||||||
# Create a container for string represents
|
# Create a container for string represents
|
||||||
inp = DIV(inp, _id='%s_%s' % (field.tablename, field.name))
|
inp = DIV(inp, _id='%s_%s' % (field.tablename, field.name))
|
||||||
trigger, cond = show_if(field.show_if)
|
trigger, cond = show_if(field.show_if)
|
||||||
@@ -2662,7 +2662,7 @@ class SQLFORM(FORM):
|
|||||||
value = ''
|
value = ''
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
value = truncate_string(value, maxlength)
|
value = truncate_string(value, maxlength)
|
||||||
elif not isinstance(value, DIV):
|
elif not isinstance(value, XmlComponent):
|
||||||
value = field.formatter(value)
|
value = field.formatter(value)
|
||||||
trcols.append(TD(value))
|
trcols.append(TD(value))
|
||||||
row_buttons = TD(_class='row_buttons', _nowrap=True)
|
row_buttons = TD(_class='row_buttons', _nowrap=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user