[Zope] Searching File-objects in a Folder
Jens Vagelpohl
jens@digicool.com
Tue, 4 Jan 2000 07:43:36 -0500
hi richard,
to iterate over a list of e.g. File objects in a folder named myFolder you
could do this:
<dtml-in "myFolder.objectValues(['File'])">
Found file id <dtml-var id> with name <dtml-var title>
</dtml-in>
the objectValues function takes a list as argument, so you could look for
more than one type:
<dtml-in "myFolder.objectValues(['File', 'Image'])">
.....
the ZQR (Zope Quick Reference) is a good place to look for documentation,
it's at http://www.zope.org/Members/ZQR
jens
----
Jens Vagelpohl jens@digicool.com
Software Engineer www.digicool.com
Digital Creations (888) 344-4332
Got Zope?
----
> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Richard Smol
> Sent: Tuesday, January 04, 2000 07:06
> To: zope@zope.org
> Subject: [Zope] Searching File-objects in a Folder
>
>
> Hi there,
>
> For practice I want to implement WikiWiki in Zope. For that, I for one
> thing have to be able to see if a certain File-object exists in a Folder.
> What method can I use for that? I tried several from the ZQR, but nothing
> works. I also have trouble just to get a list of Files in the Folder.
> Here's a code-fragment of what I try to do in DTML:
>
> <dtml-if "Files.getAttributeNode('<dtml-var file>')">
> The file <dtml-var file> exists
> <dtml-else>
> The file <dtml-var file> does NOT exist
> </dtml-if>
> <P>
> A list of files:
> <dtml-in "Files.getChildNodes()">
> Found: <dtml-var "_['sequence-item']"><br>
> </dtml-in>
>
> So how do I screw up?
>
> TIA!
>
> RS
>
> _______________________________________________
> 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 )
>
>