fixed problem with widget and list:string

This commit is contained in:
mdipierro
2013-09-19 22:03:37 -05:00
parent d3ab2e73d5
commit e7a9457249
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.6.3-stable+timestamp.2013.09.19.21.43.19
Version 2.6.3-stable+timestamp.2013.09.19.22.02.47
+1 -2
View File
@@ -292,6 +292,7 @@ class ListWidget(StringWidget):
_class = 'string'
requires = field.requires if isinstance(
field.requires, (IS_NOT_EMPTY, IS_LIST_OF)) else None
if isinstance(value,str): value = [value]
nvalue = value or ['']
items = [LI(INPUT(_id=_id, _class=_class, _name=_name,
value=v, hideerror=k < len(nvalue) - 1,
@@ -1356,8 +1357,6 @@ class SQLFORM(FORM):
value = self.record[fieldname]
else:
value = self.table[fieldname].default
if field.type.startswith('list:') and isinstance(value, str):
value = [value]
row_id = '%s_%s%s' % (
self.table, fieldname, SQLFORM.ID_ROW_SUFFIX)
widget = field.widget(field, value)