[Zope] Beginner DTML question: dereferencing a variable

Richard Wackerbarth rkw@dataplex.net
Tue, 6 Apr 1999 08:37:27 -0500 (CDT)


On Tue, 6 Apr 1999, Michel Pelletier wrote:
> > Martin Dougiamas wrote:
> > > I want to check if a folder of that name already exists
> > > under the current folder, so I can decide to create it or not.

> <!--#in "objectIds('Folder')-->
>   <!--#if "id == theusername"-->
>     Folder Exists
>   <!--#/if-->
> <!--#/in-->
> 
> You want to use a DTML Method to get the expected result.

OK, that handles the case where you want to find the object and do
something to it.

How do you propose to handle the opposite case (which Dougiamas-san
requested) -- do something if the entry DOES NOT exist.

IMHO, this calls for a local variable to set and test.

You might use REQUEST.set('I_found_the_folder' ...

However, the use of the global REQUEST namespace has its hazards :-(