[Zope3-Users] Re: EditForm fails in SiteManager because of containment constraint
Hermann Himmelbauer
dusty at qwer.tk
Sun Apr 8 09:12:27 EDT 2007
Am Samstag, 7. April 2007 18:43 schrieb Christophe Combelles:
> Jürgen Kartnaller a écrit :
> > Christophe Combelles wrote:
> >> 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)
> >
> > 'container' adds __parent__ as schema.Field attribute to your interface.
> > You need to omit __parent__ in your formlib form_fields definition.
>
> thanks, that's it, so I will omit only __parent__
> You had already answered while I was still writing my previous post :)
>
> Couldn't this thing be managed by the formlib itself?
> The error is not explicit and does not mention __parent__ anywhere
Yes, this was also my problem - the error message was quite cryptic and it
took me hours to find out the reason.
A good solution would be to either making the error message more verbose, or
to automatically omit such attributes in the formlib (which could also lead
to other problems).
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