[Zope-CMF] is this tiny patch to CMFCore/Expression.py okay?
Florent Guillaume
fg at nuxeo.com
Sat Dec 4 19:08:38 EST 2004
In article <41B1F976.1050109 at simplistix.co.uk> you write:
> Okay, attempt number 2:
>
> Chris Withers wrote:
>
> > Index: Expression.py
> > ===================================================================
> > --- Expression.py (revision 1038)
> > +++ Expression.py (working copy)
> > @@ -105,6 +105,7 @@
> > 'modules': SecureModuleImporter,
> > 'member': member,
> > 'here': object,
> > + 'parent': aq_parent(object),
> > }
> > return getEngine().getContext(data)
>
> As for Dieter's points 2 & 3, Florent actually answered both of those
> ;-) The Acquisition.aq_parent function isn't available in expressions.
> I think the closest you can get is "object.aq_parent or object", but is
> that enough?
I don't see why not use object.aq_parent, indeed, as Dieter said, it's a
rare enough situation that it doesn't warrant inclusion into the
standard expression namespace.
And surely any object to which you apply this expression will inherit
from Acquisition.Implicit or Explicit, thus making object.aq_parent ok
to use.
> Florent suggested aq_parent(aq_inner(object)), but I think that's
> already available through the name 'folder'.
Yeah so that one is already there.
> Anyone got any more points before I commit?
For the reasons above, I'm still -1 on it.
Florent
--
Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com
More information about the Zope-CMF
mailing list