[Zope3-Users] WrongContainedType

Tim Cook timothywayne.cook at gmail.com
Fri Oct 10 11:57:27 EDT 2008


On Fri, 2008-10-10 at 12:38 -0300, Tim Cook wrote:

> Maybe it's just a requirement to fix the code?
> 
> The code at around line 466 in _field.py says
>         errors = _validate_fields(self.schema, value)
>         if errors:
>             raise WrongContainedType(errors)
> 
> errors is an empty list so should the if statement just be a test to see
> if the list is not empty?


Actually, the problem is that the second iteration of the check causes
the first list not to be empty anymore.

by adding the line:
        print 'Object schema validation errors=',errors
before the if errors: line
I get this output:

Object schema validation errors= []
Object schema validation errors= [, []]

So I'm not sure WHERE errors is being created as a list each pass.  I
tried setting it to None with an else: clause and that didn't fix it.  

I hope this can help someone track down the problem.  For now I have
just commented out the error condition:
        #if errors:
        #    raise WrongContainedType(errors)


Cheers,
--Tim


-- 
Timothy Cook, MSc
Health Informatics Research & Development Services
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook 
Skype ID == timothy.cook 
**************************************************************
*You may get my Public GPG key from  popular keyservers or   *
*from this link http://timothywayne.cook.googlepages.com/home*
**************************************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20081010/8af251d5/attachment.bin 


More information about the Zope3-users mailing list