[Zope3-dev] Re: method and content namespaces

Jim Fulton jim@zope.com
Tue, 14 May 2002 18:45:34 -0400


Steve Alexander wrote:
> 
> Jim Fulton wrote:
> > Steve,
> >
> > I think you added support for method and content namespaces
> > for container traversal.  I'd like to change this around a bit:
> >
> > - There will be standard namespaces:
> >
> >   attribute -- Any attribute, including methods
> 
> How about abbreviating it to "attr" ?

I'm inclined to avoid abbreviations. We've had one vote against
abbreviation. I'd be interested to hear some other opinions.

>    tal:content="attr/name"

It would be tal:content="foo/name;attr" or  
tal:content="foo/name;attribute"


> 
> >   item -- Mapping item (not container item unless container also
> >           does mapping)
> 
> How about "map" or "mapping" instead?

I don't like that very much.

In python, we refer to the things in mappings as "items".

...

> 
> I don't feel strongly either way about these alternative names. I'm just
> presenting an alternative that came to mind.

Thanks. :)
 
> >   accessor -- Name is an accessor function that gets called
> 
> Please explain what this means.

Accessors are methods that return data. For example, requets have a 
method, getResponse.  You could do:

  tal:content="request/getResponse;accessor/getBase"

Basically, it would allow you to call a method in the middle of a 
path.


> 
> >   These can be used with any object.
> >
> > - I generally don't want individual objects to have custom namespaces,
> >   but I can bend on this if we think it's important.
> >
> >   hm..... Waaa. It probably *is* important.
> 
> The container->content pattern is very common to content management.

Yup.
 
> >   So, maybe containers should provide a content namespace. Hm. I guess I
> >   can handle this in a general way.
> 
> That would be nice. Perhaps tie this into adapting to IContainer.
> 
> > - If no namespace is specified, look in content and then in attributes.
> 
> Where do views and resources fit into this?

They are additional namespaces, of course.

BTW, we *could* also have adapters:

  foo/Zope.Workflow.IWorlflowItem.;adapter
 
> I expect that it will still be possible to specify custom traversal for
> a particular kind of component.

Yes.

Jim

--
Jim Fulton           mailto:jim@zope.com       Python Powered!        
CTO                  (888) 344-4332            http://www.python.org  
Zope Corporation     http://www.zope.com       http://www.zope.org