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
|
path_info = next
|
||||||
else:
|
else:
|
||||||
path_info = r.env.path_info
|
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:
|
if r.get_vars and not next:
|
||||||
uri += '?' + urlencode(r.get_vars)
|
uri += '?' + urlencode(r.get_vars)
|
||||||
return uri
|
return uri
|
||||||
|
|||||||
+1
-1
@@ -1745,7 +1745,7 @@ class INPUT(DIV):
|
|||||||
elif not t == 'submit':
|
elif not t == 'submit':
|
||||||
if value is None:
|
if value is None:
|
||||||
self['value'] = _value
|
self['value'] = _value
|
||||||
else:
|
elif not isinstance(value,list):
|
||||||
self['_value'] = value
|
self['_value'] = value
|
||||||
|
|
||||||
def xml(self):
|
def xml(self):
|
||||||
|
|||||||
+6
-4
@@ -239,11 +239,13 @@ class ListWidget(StringWidget):
|
|||||||
_name = field.name
|
_name = field.name
|
||||||
if field.type=='list:integer': _class = 'integer'
|
if field.type=='list:integer': _class = 'integer'
|
||||||
else: _class = 'string'
|
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'
|
attributes['_style'] = 'list-style:none'
|
||||||
items=[LI(INPUT(_id=_id, _class=_class, _name=_name,
|
items = [LI(INPUT(_id=_id, _class=_class, _name=_name,
|
||||||
value=v, hideerror=True, requires=requires),
|
value=v, hideerror=k<len(value)-1,
|
||||||
**attributes) for v in value or ['']]
|
requires=requires),
|
||||||
|
**attributes) for (k,v) in enumerate(value or [''])]
|
||||||
script=SCRIPT("""
|
script=SCRIPT("""
|
||||||
// from http://refactormycode.com/codes/694-expanding-input-list-using-jquery
|
// from http://refactormycode.com/codes/694-expanding-input-list-using-jquery
|
||||||
(function(){
|
(function(){
|
||||||
|
|||||||
+6
-5
@@ -2329,11 +2329,12 @@ class IS_LIST_OF(Validator):
|
|||||||
new_value = []
|
new_value = []
|
||||||
if self.other:
|
if self.other:
|
||||||
for item in ivalue:
|
for item in ivalue:
|
||||||
(v, e) = self.other(item)
|
if item.strip():
|
||||||
if e:
|
(v, e) = self.other(item)
|
||||||
return (value, e)
|
if e:
|
||||||
else:
|
return (ivalue, e)
|
||||||
new_value.append(v)
|
else:
|
||||||
|
new_value.append(v)
|
||||||
ivalue = new_value
|
ivalue = new_value
|
||||||
return (ivalue, None)
|
return (ivalue, None)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user