Author: ianb
Date: 2006-08-24 08:38:27 -0600 (Thu, 24 Aug 2006)
New Revision: 1882
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/api.py
Log:
Added variable_encode-related arguments to Invalid.unpack_errors; from Martin
Stein
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2006-08-22 15:04:33 UTC (rev 1881)
+++ FormEncode/trunk/docs/news.txt 2006-08-24 14:38:27 UTC (rev 1882)
@@ -8,6 +8,9 @@
* ``String(min=1)`` implies ``not_empty`` (which seems more intuitive)
+* Added ``list_char`` and ``dict_char`` arguments to
+ ``Invalid.unpack_errors`` (passed through to ``variable_encode``)
+
0.5.1
-----
Modified: FormEncode/trunk/formencode/api.py
===================================================================
--- FormEncode/trunk/formencode/api.py 2006-08-22 15:04:33 UTC (rev 1881)
+++ FormEncode/trunk/formencode/api.py 2006-08-24 14:38:27 UTC (rev 1882)
@@ -63,7 +63,8 @@
# val += " (value: %s)" % repr(self.value)
return val
- def unpack_errors(self, encode_variables=False):
+ def unpack_errors(self, encode_variables=False, dict_char='.',
+ list_char='-'):
"""
Returns the error as a simple data structure -- lists,
dictionaries, and strings.
@@ -91,7 +92,9 @@
result[name] = item.unpack_errors()
if encode_variables:
import variabledecode
- result = variabledecode.variable_encode(result,
add_repetitions=False)
+ result = variabledecode.variable_encode(result,
add_repetitions=False,
+ dict_char=dict_char,
+ list_char=list_char)
return result
else:
assert not encode_variables, (
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs