[Zope] hasattr
Evan Simpson
evan@4-am.com
Sat, 29 Jan 2000 06:24:35 -0600
----- Original Message -----
From: Kyle Burnett <kburnett@ep.newtimes.com>
> i am trying to see if the file cover.gif exists.
File, or Zope object? I'll assume object.
> the directory structure is:
> /palette4/2000-01-27/cover.gif.
> <dtml-if "_.hasattr(PARENTS[-2].palette4,issue,'cover.gif')">
Can the named issue (a string, right?) be presumed to exist? If so,
<dtml-if "_.hasattr(PARENTS[-2].palette4[issue], 'cover.gif')">
would be one way to do it.
Cheers,
Evan @ 4-am (and soon digicool)