[Zope3-dev] spelling of namespace signifiers

Jim Fulton jim@zope.com
Thu, 06 Jun 2002 10:55:24 -0400


Shane Hathaway wrote:
> 
> Jim Fulton wrote:
> > Shane Hathaway wrote:
> >>I'll express my interpretation of the above in Python:
> >>
> >>parts = traversed_name.split('--', 1)
> >>if len(parts) == 2:
> >>     namespace, name = parts
> >>else:
> >>     namespace, name = 'content', traversed_name
> >>
> >>Is that your interpretation?
> >
> >
> > No. The part before the first -- is the namespace and the
> > part after the first -- is the name.
> 
> Uh, I'm pretty sure that's exactly what I said.

No, you said that if there would more than 1 set of --s, 
then the name would be the original name and the namespace would
be content.

> >>Unfortunately, "--" can appear in lots of
> >>valid filenames, especially since it's the standard ASCII representation
> >>of long hyphens.
> >
> >
> > I've never seen it in any. Have you?
> 
> No.  I'm not a good sample, though. ;-)
> 
> >>Here are my thoughts:
> >>
> >>1) Our story is that the namespace qualifier isn't necessary for
> >>non-containerish objects, and necessary for containerish objects.
> >
> >
> > It's not necessary for containerish objects if the item and view namespaces
> > don't overlap.
> 
> It's necessary for Zope's basic Folder type, which can hold any name.  I
> assume we're keeping it.

What ids are legal is a matter of policy enforced by the add component.
People could install an alternate add component that enforced a more
restrictive naming policy, such as one like Zope 2's (e.g. Disallow
a name if there is a view of the same name). Some people might just
be willing to take their chances. The current container traverser will
look for a view if an item can't be found.

 
> >>3) Therefore views intended for non-containerish objects can't be used
> >>on containerish objects.  But views intended for containerish objects
> >>can be used anywhere.
> >
> >
> > No, you just have to spell the URLs differently.
> 
> Relative URLs are embedded in the views, aren't they?  If so, views
> intended for non-containerish objects can't be used on folders.

Fair enough. Really general views will need to use the full syntax.

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