[Zope3-checkins] CVS: Zope3/src/zope/schema - _field.py:1.25

Dominik Huber dominik at projekt01.ch
Wed Dec 17 04:51:43 EST 2003


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

Modified Files:
	_field.py 
Log Message:
Bugfix zope.schema._field.Object:
-----------------------------------------------------
Validation of object field fixed. Validate only attributes of the schema 
that are implemented as fields.


=== Zope3/src/zope/schema/_field.py 1.24 => 1.25 ===
--- Zope3/src/zope/schema/_field.py:1.24	Mon Nov 24 12:02:14 2003
+++ Zope3/src/zope/schema/_field.py	Wed Dec 17 04:51:42 2003
@@ -228,8 +228,10 @@
     for name in schema.names(all=True):
         if not IMethod.isImplementedBy(schema[name]):
             try:
-                field = schema[name]
-                field.validate(getattr(value, name))
+                attribute = schema[name]
+                if IField.isImplementedBy(attribute):
+                    # validate attributes that are fields  
+                    attribute.validate(getattr(value, name))
             except ValidationError, error:
                 errors.append(error)
             except AttributeError, error:




More information about the Zope3-Checkins mailing list