Am 02.06.2009 um 14:47 schrieb Wichert Akkerman:
> That assumes the object has already been constructed and you're only
> testing constraints for adding the instance to the container. Our use
> case is different: we are testing at a point where construction has
> not happened yet.
I think there are two things to consider here:
1) can I create the object at all?
2) can I add it to a particular container?
so yuppies' reference to checkFactory and checkObject are definitely
the places to start. Your use case refers not to object creation but
containment depths so you're not checking the factory as whether you
can create the object but the container as to whether it may contain
the object. Surely extending the sample class to count your
containment depth will solve the problem: raise the error and rollback
PS. written without reference to the scary code but not convinced that
extending TypeTool in anyway is a solution to anything.
Zope-CMF maillist - Zope-CMF@lists.zope.org
See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests