[Zope3-checkins] CVS: Zope3/src/zope/schema - vocabulary.py:1.16

Fred L. Drake, Jr. fred@zope.com
Mon, 16 Jun 2003 13:05:04 -0400


Update of /cvs-repository/Zope3/src/zope/schema
In directory cvs.zope.org:/tmp/cvs-serv16418

Modified Files:
	vocabulary.py 
Log Message:
For multi-select vocabulary fields, if the default is not specified,
it should be an empty list rather than None.  None may still be
explicitly specified.


=== Zope3/src/zope/schema/vocabulary.py 1.15 => 1.16 ===
--- Zope3/src/zope/schema/vocabulary.py:1.15	Fri Jun 13 11:30:45 2003
+++ Zope3/src/zope/schema/vocabulary.py	Mon Jun 16 13:05:04 2003
@@ -103,6 +103,8 @@
         if self.__class__ is VocabularyMultiField:
             raise NotImplementedError(
                 "The VocabularyMultiField class cannot be used directly.")
+        if "default" not in kw:
+            kw["default"] = []
         super(VocabularyMultiField, self).__init__(**kw)
 
     def _validate(self, value):