|
From: <sub...@co...> - 2006-08-24 14:38:33
|
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, (
|