Author: ianb
Date: 2006-12-13 18:26:00 -0700 (Wed, 13 Dec 2006)
New Revision: 2130

Modified:
   FormEncode/trunk/docs/news.txt
   FormEncode/trunk/formencode/api.py
Log:
Get rid of None values in unpack_errors

Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt      2006-12-14 01:25:44 UTC (rev 2129)
+++ FormEncode/trunk/docs/news.txt      2006-12-14 01:26:00 UTC (rev 2130)
@@ -17,6 +17,10 @@
 * ``from formencode.validators import *`` will import the ``Invalid``
   exception now.
 
+* ``Invalid().unpack_errors(encode_variables=True)`` now filters out
+  None values (which ``ForEach`` can produce even for keys with no
+  errors).
+
 0.6
 ---
 

Modified: FormEncode/trunk/formencode/api.py
===================================================================
--- FormEncode/trunk/formencode/api.py  2006-12-14 01:25:44 UTC (rev 2129)
+++ FormEncode/trunk/formencode/api.py  2006-12-14 01:26:00 UTC (rev 2130)
@@ -119,6 +119,9 @@
                 result = variabledecode.variable_encode(result, 
add_repetitions=False,
                                                         dict_char=dict_char,
                                                         list_char=list_char)
+                for key in result.keys():
+                    if not result[key]:
+                        del result[key]
             return result
         else:
             assert not encode_variables, (


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs

Reply via email to