hello, can anyone tell me where to find a dtml method or python script that checks whether a special document in a zope folder exists when called. dependend on this query i would like to carry out actions. if "file exists" .... else .... thanks a lot, jan
Hi Jan, --On Sonntag, 20. Mai 2001 03:26 +0200 Jan Sew <esolutions@gmx.net> wrote:
hello,
can anyone tell me where to find a dtml method or python script that checks whether a special document in a zope folder exists when called. dependend on this query i would like to carry out actions.
if "file exists" ....
else ....
thanks a lot,
Although Zope uses the term "folder" these objects are not very similar to a filesystem folder. In fact, _every_ zope object can (and would) have subobjects. Just to clarify this out. Zope is only a tree of objects, subobjects, subsubobjects and so on. (See your favourite python manual) In your case, if your namespace is mapped to _ you can use: if hasattr(_,'yoursciptobject'): ... or in DTML you would write <dtml-if yourscriptobject> ... </dtml-if> Please note: because of acquisition, subobjects with the same id are looked up on parent request containers. HTH Tino Wildenhain
On Sun, May 20, 2001 at 03:26:52AM +0200, Jan Sew wrote:
can anyone tell me where to find a dtml method or python script that checks whether a special document in a zope folder exists when called. dependend on this query i would like to carry out actions.
FAQ -- http://lists.zope.org/pipermail/zope/2000-April/108625.html has one solution. (Google search for 'zope object existence' put that link right up front.) -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
participants (3)
-
Jan Sew -
Mike Renfro -
Tino Wildenhain