zope.schema validation can create read/write conflicts

Souheil CHELFOUH <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Hello,

I've been experiencing, for quite some time, now, read/write conflicts
in my projects.
I've decided to hunt the problem down and it brought me down to the
field validation in zope.schema.

My use case is the following :

class SomeAdapter(object):
   my_object = FieldProperty(ISomeInterface['my_object'])

   def __init__(self, context):
       self.my_object = context


If "my _object" from ISomeInterface is an Object field and has a
'schema' property, zope.schema will validate it.
The validation code writes an attribute on the value that is being
validated and therefore can create a read/write error.

The incriminated code is here :
http://svn.zope.org/zope.schema/trunk/src/zope/schema/_field.py?rev=111614&r1=110535&r2=111614

In my case, the value was an OOBTree and that caused a lot of read/write errors.
Can we do something about this validation code ?
Could it be a possible solution to change the "__validating_schema"
attribute into a _v_ attribute, to avoid the persistency ?

Thank you for reading me.

- Souheil
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.