[Zope-dev] Re: [Zope] Re: Two newbie questions + Zope patch

Evan Simpson evan@tokenexchange.com
Thu, 9 Sep 1999 08:38:34 -0500


----- Original Message -----
From: Michel Pelletier <michel@digicool.com>
> > I'm not sure what your getting at here, but if you want to resolve a
> > path to a URL try:
> >
> > <dtml-with "REQUEST.resolve_url((SCRIPT_NAME + '/path/to/object'))">
> >   blah
> > </dtml-with>
> >
[description of ZCatalog.Catalog.ZCatalog.ZCatalog.Catalog <wink> snipped]

This is all well and good, but *not* what most people who ask this sort of
question of the list want (IMNSHO).  They want some simple way of getting a
properly acquired object using a *relative* path from another acquired
object.  Sometimes they want to use a pseudo-URL as a name:

<dtml-var number/3/the_larch>

and other times to resolve a stored path fragment relative to a container:

<dtml-with thingy><dtml-var "_[varwithstringpath]"></dtml-with>

and yet others to acquire an unresolved object from another object:

<dtml-var "_.getattr(eric(), 'half/a/bee')">

Since slashes are not legal in object identifiers, I see no reason why all
of the above should not be valid.  If there's a reason I haven't thought of,
please let me know!

stop-me-before-I-patch-again-<wink>-ly y'rs
Evan Simpson