[Product-Developers] Acquisition context inside a Plone behavior

Nathan Van Gheem nathan at vangheem.us
Wed Jan 29 14:04:27 UTC 2014


could hack it by getting the parent object with the path of the child
object.


On Wed, Jan 29, 2014 at 7:29 AM, Gaudenz Steinlin <gaudenz at soziologie.ch>wrote:

> ajung <lists at zopyx.com> writes:
>
> > Hi there,
> >
> > I am implementing a customer shortname generation policy (comparable to
> > INameFromTitle) where the behavior implementing the policy must get hold
> of
> > the parent folder in order to fetch a configurable prefix that is used as
> > part of the generated id. I followed the implementation
> >
> >
> http://stackoverflow.com/questions/7974285/is-there-a-way-to-extend-plone-dexteritys-inamefromtitle-behavior
> >
> > Unfortunately the 'context' object is not acquisition wrapped. Is there
> some
> > way to get hold of the parent object in some way?
>
> Maybe it's easier to create a more specific INameChooser adapter for the
> folders that will contain your objects. The INameChooser is adapted to
> the folder and the folder is thus available as self.context inside the
> adapter.
>
> Gaudenz
> --
> Ever tried. Ever failed. No matter.
> Try again. Fail again. Fail better.
> ~ Samuel Beckett ~
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> https://lists.plone.org/mailman/listinfo/plone-product-developers
>



-- 
Nathan Van Gheem
Solutions Architect
Wildcard Corp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20140129/009fe7e6/attachment.html>


More information about the Product-Developers mailing list