[Zope] array won't clear
michael.taņag
almightymike@yahoo.com
Wed, 8 Jan 2003 02:39:24 -0800 (PST)
hi again.
OK. I tried this to get the files in my directory into an array (even
those in the subdirectory). I got the file objects into the array, but
i can't seem to clear the array afterwards. so everytime i run the dtml
method, the array keeps appending.
this is the DTML
<dtml-in expr="test_script()" sort="bobobase_modification_time"
reverse>
<dtml-var id> - <dtml-var bobobase_modification_time fmt="aCommon"><br>
</dtml-in>
this is test script - i got this from zopelabs. I just modified it so
that the contents of the folder will be loaded into the array
#parameters obj=None, results=[]
if obj is None:
# start 'here' unless else is specified
obj = context
# loop though everything!
for object in obj.objectValues():
# is the object folderish
if object.isPrincipiaFolderish:
# go deeper
print "Folderish title: %s"%object.title_or_id()
##### start of my code #####
folderName = object.getId()
for file in obj[folderName].objectValues('File'):
print " %s" %file.getId()
results.append(file)
print "<br>"
##### end of my code #####
print context.test_script(object)
# return printed
return results
anyone can help me? thanks in advance!
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com