Just to follow up on this issue. I have created a bug report on launchpad with a possible fix. However, I do not know for sure that this doesn't have other negative consequences.
https://bugs.launchpad.net/zope3/+bug/301226 Cheers, Tim On Thu, 2008-10-09 at 18:08 -0700, Marius Gedminas wrote: > On Thu, Oct 09, 2008 at 08:42:21AM -0300, Tim Cook wrote: > > I am having difficulty understanding this error. > > > > It occurs in the call: > > ontObj.parentArchetype = ObjectRef(oid,u'openehr',u'ARCHETYPE') > > > > The first parameter for ObjectRef is declared in the schema as: > > > > refId = Object( > > schema=IObjectId, > > title = _(u'Id'), > > description = _(u'Globally unique id of an object (of type > > ObjectId), regardless of where it is stored.'), > > required = True > > ) > > > > If I print the parameter 'oid' it does correctly report: > > <oship.openehr.rm.support.identification.objectid.ObjectId object at > > 0x1b70210> > > > > the other two parameters for ObjectRef are declared as TextLines. > > > > The traceback is: > > zope.schema.interfaces.WrongContainedType: [, []] > > Oh dear. That's one of the worst error messages I've seen. > > > What I do not understand is how to interpret the [, []] > > By reading the source code. > > Object field validation actually attempts to validate the schema > (IObjectId in this case) of the object you're trying to store (the > ObjectId object, in this case). If any of the fields cannot be > validated during this nested validation, you get a WrongContainedType > with the list of errors (one for each field). > > Apparently those errors have horrible __repr__s. That ought to be > fixed. > > > I'm not passing a list nor is the schema using a list. > > > > I realize that this may be pretty basic but I am missing something in > > reading the error. > > I'd put a breakpoint in zope.schema._field, specifically, in > Object._validate, and try to see what's wrong by single-stepping. > > Marius Gedminas > _______________________________________________ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users -- 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* **************************************************************
<<attachment: oe_trick.png>>
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users