[Zope3-Users] EditForm fails in SiteManager because of containment constraint

Hermann Himmelbauer dusty at qwer.tk
Sun Apr 8 09:10:03 EDT 2007


Am Samstag, 7. April 2007 18:06 schrieb Christophe Combelles:
> Hello,
>
> I have a regular content object which uses the formlib for its edit view.
> Nothing special, just like a Recipe.
> But I want this object to only reside in the Site Manager, because it will
> be used as a configurable local utility (some kind of LocalKitchenTools
> utility)
>
> Everything is perfect, and the EditForm works well until I want to tell
> this object to be only contained in the SiteManager. So I just add this
> statement in the interface:
>
> containers(ILocalSiteManager)
> or
> containers(ISiteManagementFolder)
>
> When I do any of these, the EditForm fails with a ComponentLookupError
> What Am I missing? Why does a simple constraint create an error on this?

I *think* I've got the same problem - the thing is that interfaces inheriting 
from container interfaces inherit the __name__ and __parent__ attributes. And 
the formlib classes try to set up widgets for these attributes, which results 
in a component lookup error.

I simply omitted these two attributes, which solved the problem.

Regards,
Hermann

-- 
x1 at aon.at
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7


More information about the Zope3-users mailing list