[Zope] random object with properties

Andy McKay andym@ActiveState.com
Tue, 21 Nov 2000 12:14:43 -0800


You have to actually get the image to display its caption (untested)

<dtml-with expr="_.whrandom.choice(objectValues('Photo'))">
<dtml-var sequence-item>
<dtml-if caption><dtml-var caption></dtml-if>
</dtml-var>

--
  Andy McKay, Developer.
  ActiveState.
----- Original Message ----- 
From: "Kevin Worth" <kworth@engin.umich.edu>
To: <zope@zope.org>
Sent: Tuesday, November 21, 2000 11:57 AM
Subject: [Zope] random object with properties


> I'm trying to find/write a method that will choose a random image 
> from a folder (easy, using the random how-to)  But I also want to 
> display the caption for the image, which is a property of that image.
> 
> This method:
> 
> <dtml-var expr="_.whrandom.choice(objectValues('Photo'))">
> <dtml-if caption><dtml-var caption></dtml-if>
> 
> presents me with a random photo, but no caption.  At one point, I had 
> it pulling out a random photo and a random caption, but I need the 
> associated caption.
> 
> What am I missing here?
> 
> Kevin
> -- 
> -----------------------------------------------
> Kevin Worth <kworth@engin.umich.edu>
> Computer Systems Specialist II and Adjunct Lecturer
> Department of Materials Science and Engineering
> University of Michigan 
> 
> _______________________________________________
> 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 )
>