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

Fred L. Drake, Jr. fred@zope.com
Fri, 2 May 2003 11:17:46 -0400


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

Modified Files:
      Tag: schema-vocabulary-branch
	vocabulary.py 
Log Message:
- classes are defined using the "class" statement, not "def"!
- VocabularyMultiField._validate(): check the passed-in value, not
  self.value


=== Zope3/src/zope/schema/vocabulary.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/vocabulary.py:1.1.2.1	Fri May  2 10:11:15 2003
+++ Zope3/src/zope/schema/vocabulary.py	Fri May  2 11:17:45 2003
@@ -162,7 +162,7 @@
         return clone
 
 
-def VocabularyMultiField(VocabularyField):
+class VocabularyMultiField(VocabularyField):
     """Field that adds support for use of an external vocabulary.
 
     The value is a collection of values from the vocabulary.
@@ -173,7 +173,7 @@
         vocab = self.vocabulary
         if vocab is None:
             raise ValueError("can't validate value without vocabulary")
-        for v in self.value:
+        for v in value:
             if v not in vocab:
                 raise ValidationError(errornames.ConstraintNotSatisfied, v)