Document translate argument of Invalid.asdict
This commit is contained in:
@@ -7,6 +7,12 @@ Bug Fixes
|
||||
- Un-break wrapping of callable instances as ``colander.deferred``.
|
||||
See https://github.com/Pylons/colander/issues/141.
|
||||
|
||||
Features
|
||||
~~~~~~~~
|
||||
|
||||
- Allow localization of error messages returned by ``colander.Invalid.asdict``
|
||||
by adding an optional ``translate`` callable argument.
|
||||
|
||||
1.0b1 (2013-09-01)
|
||||
------------------
|
||||
|
||||
|
@@ -114,3 +114,4 @@ Contributors
|
||||
- Brian Sutherland, 2013/08/16
|
||||
- Peter Lamut, 2013/08/16
|
||||
- Veeti Paananen, 2013/08/20
|
||||
- Alex Marandon, 2013/12/21
|
||||
|
@@ -167,7 +167,12 @@ class Invalid(Exception):
|
||||
|
||||
def asdict(self, translate=None):
|
||||
""" Return a dictionary containing a basic
|
||||
(non-language-translated) error report for this exception"""
|
||||
(non-language-translated) error report for this exception.
|
||||
|
||||
If ``translate`` is supplied, it must be a callable taking a
|
||||
translation string as its sole argument and returning a localized,
|
||||
interpolated string.
|
||||
"""
|
||||
paths = self.paths()
|
||||
errors = {}
|
||||
for path in paths:
|
||||
|
Reference in New Issue
Block a user