fixed issue 1010, error reporting on list:string
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 2.0.9 (2012-09-16 10:43:34) stable
|
||||
Version 2.0.9 (2012-09-16 11:42:59) stable
|
||||
|
||||
@@ -107,7 +107,7 @@ server for requests. It can be used for the optional"scope" parameters for Face
|
||||
path_info = next
|
||||
else:
|
||||
path_info = r.env.path_info
|
||||
uri = '%s://%s%s' %(url_scheme, http_host, path_info)
|
||||
uri = '%s://%s%s' % (url_scheme, http_host, path_info)
|
||||
if r.get_vars and not next:
|
||||
uri += '?' + urlencode(r.get_vars)
|
||||
return uri
|
||||
|
||||
+1
-1
@@ -1745,7 +1745,7 @@ class INPUT(DIV):
|
||||
elif not t == 'submit':
|
||||
if value is None:
|
||||
self['value'] = _value
|
||||
else:
|
||||
elif not isinstance(value,list):
|
||||
self['_value'] = value
|
||||
|
||||
def xml(self):
|
||||
|
||||
+6
-4
@@ -239,11 +239,13 @@ class ListWidget(StringWidget):
|
||||
_name = field.name
|
||||
if field.type=='list:integer': _class = 'integer'
|
||||
else: _class = 'string'
|
||||
requires = field.requires if isinstance(field.requires, (IS_NOT_EMPTY, IS_LIST_OF)) else None
|
||||
requires = field.requires if isinstance(
|
||||
field.requires, (IS_NOT_EMPTY, IS_LIST_OF)) else None
|
||||
attributes['_style'] = 'list-style:none'
|
||||
items=[LI(INPUT(_id=_id, _class=_class, _name=_name,
|
||||
value=v, hideerror=True, requires=requires),
|
||||
**attributes) for v in value or ['']]
|
||||
items = [LI(INPUT(_id=_id, _class=_class, _name=_name,
|
||||
value=v, hideerror=k<len(value)-1,
|
||||
requires=requires),
|
||||
**attributes) for (k,v) in enumerate(value or [''])]
|
||||
script=SCRIPT("""
|
||||
// from http://refactormycode.com/codes/694-expanding-input-list-using-jquery
|
||||
(function(){
|
||||
|
||||
+6
-5
@@ -2329,11 +2329,12 @@ class IS_LIST_OF(Validator):
|
||||
new_value = []
|
||||
if self.other:
|
||||
for item in ivalue:
|
||||
(v, e) = self.other(item)
|
||||
if e:
|
||||
return (value, e)
|
||||
else:
|
||||
new_value.append(v)
|
||||
if item.strip():
|
||||
(v, e) = self.other(item)
|
||||
if e:
|
||||
return (ivalue, e)
|
||||
else:
|
||||
new_value.append(v)
|
||||
ivalue = new_value
|
||||
return (ivalue, None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user