[Zope] test for an object's existence -->based on URL?

Kevin Howe khowe@performance-net.com
Fri, 28 Apr 2000 19:45:25 -0300


Hi,

Is it possible to do this given a URL (short of parsing the URL and plugging
it into the "hasattr" tag)?

something like this:

<dtml-if "REQUEST.resolve_url.hasattr('http://domain/my/object')">
  do something
</dtml-if>

kh

----- Original Message -----
From: "Chris McDonough" <chrism@digicool.com>
To: "'Kevin Howe'" <khowe@performance-net.com>; "ZOPE Mailing List"
<zope@zope.org>
Sent: Friday, April 28, 2000 7:47 PM
Subject: RE: [Zope] test for an object's existence?


> <dtml if "_.hasattr(my, 'object')">
> do something
> </dtml-if>
>
>
> > -----Original Message-----
> > From: Kevin Howe [mailto:khowe@performance-net.com]
> > Sent: Friday, April 28, 2000 6:12 PM
> > To: ZOPE Mailing List
> > Subject: [Zope] test for an object's existence?
> >
> >
> > How do I check for an object's existence in the ZOPE tree?
> >
> > I thought one of these would work:
> >
> > <dtml-if "REQUEST.resolve_url('http://domain/my/object')">
> >   Yes
> > <dtml-else>
> >   No
> > </dtml-if>
> >
> > OR
> >
> > <dtml-if "my.object">
> >   Yes
> > <dtml-else>
> >   No
> > </dtml-if>
> >
> > but they completely die rather than returning a false value.
> >
> > Is there an "exists" method of some kind?
> >
> > kh
> >
> >
> >
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> >
>