fixed problem with widget and list:string
This commit is contained in:
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user