[Zope] - Accessing objects in subfolders

Jim Fulton jim.fulton@digicool.com
Mon, 11 Jan 1999 18:49:39 -0500


Michael Grinder wrote:
> 
> jim fulton <jim.fulto-@digicool.com> wrote:
> Original Article: http://www.egroups.com/list/zope/?start=1059
> > This is not an unreasonable approach, however, if you take
> > this approach, you will lose the automagic calling of methods.
> >
> > If zoot is a (non-document-template) method, then
> >
> >   <!--#if zoot-->
> >
> > is the same as:
> >
> >   <!--#if "zoot()"-->
> >
> > not
> >
> >   <!--#if "zoot"-->
> >
> > If zoot is a document template, then:
> >
> >   <!--#if zoot-->
> >
> > is equivalent to:
> >
> >   <!--#if "zoot(None,_)"-->
> 
> The automagical stuff doesn't seem to be working for me. First I tried
> <!--#in subfolder.sql_method--> and an error occurred. Then I tried
> <!--#in "subfolder.sql_method()"--> and it worked correctly. This was
> using the Linux binary distribution.

I should have explained this differently.
  
  <!--#sometag foo-->

is a shorthand for 

  <!--#sometag name="foo"-->

The name attribute treats it's argument as a name, not
an expression.  The '.' character in a name is just another
character.  The '.' character in subfolder.sql_method
is treated just like the '.' character in logo.gif.

OTOH:

  <!--#sometag "foo"-->

is a shorthand for:

  <!--#sometag expr="foo"-->

The expr attribute treats it's argument
as a Python expression.  In a Python expression, 
the '.' character is an attribute access operator.

So, perhaps we should not use the shorhand notation
in examples to avoid confusion between

  <!--#sometag foo-->

and

  <!--#sometag "foo"-->

Jim

--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (888) 344-4332              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.