[Zope] Photo Product fix/question/suggestion
Stephen Pitts
smpitts@midsouth.rr.com
Mon, 10 Jan 2000 21:33:01 -0600
On Mon, Jan 10, 2000 at 08:34:31PM -0500, Gregor wrote:
> Question:
> I have a class "FoobarInfo" that has an "image" property. This property holds
> the ID of an image to be rendered in FoobarInfo's index_html method.
>
> Therefore, in the index_html I was doing this:
>
> <img class="fooimage" alt="[Image for <dtml-var name>]" src=<dtml-var image> >
>
> And this works just spiffy. However, I want to use the Photo Product instead
> of the Image class. The code above works for Photo, too, but it does not take
> advantage of Photo's features. Now, normally you would insert the following
> into a document to render the image and use the feature I want (specifically,
> a user's preferred display size):
>
> <dtml-var "blah(REQUEST, pdcookie='1')">
<dtml-var "_.getitem(blah, 0).__call__(REQUEST, pdcookie='1')">
_.getitem(x, 0) returns a reference to an item without calling it. _[x]
gets a reference to an item and then calls it, returning a string when
you want a Photo instance.
--
Stephen Pitts
smpitts@midsouth.rr.com
webmaster - http://www.mschess.org