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

Sidnei da Silva sidnei at x3ng.com.br
Tue Aug 12 14:39:32 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/utilities
In directory cvs.zope.org:/tmp/cvs-serv32308/src/zope/app/utilities

Modified Files:
      Tag: dreamcatcher-ttwschema-branch
	schema.py 
Log Message:
A bit more progress on setting field's schema to the right types. More fixes on ZCML registration/security assertions of basic fields types.

=== Zope3/src/zope/app/utilities/schema.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/utilities/schema.py:1.1.2.1	Tue Aug 12 09:19:27 2003
+++ Zope3/src/zope/app/utilities/schema.py	Tue Aug 12 13:38:56 2003
@@ -20,9 +20,13 @@
     def addField(self, name, field):
         """Add a field to schema.
         """
-        fields = getFieldNamesInOrder(self)
-        if name in fields:
+        fields = getFieldsInOrder(self)
+        field_names = [n for n, f in fields]
+        fields = [f for n, f in fields]
+        if name in field_names:
             raise KeyError, "Field %s already exists." % name
+        if fields:
+            field.order = fields[-1].order + 1
         self._setField(name, field)
         self._p_changed = 1
 




More information about the Zope3-Checkins mailing list