[Zope] Re: Photo Product fix/question/suggestion
Gregor
vorlon@iglou.com
Mon, 10 Jan 2000 21:39:41 -0500
----- Original Message -----
From: "Andrew Lahser" <andrew@apl-software.com>
To: "Gregor" <vorlon@iglou.com>; <zope@zope.org>
Sent: Monday, January 10, 2000 9:00 PM
Subject: Re: Photo Product fix/question/suggestion
> I'll answer the last first, I have been developing a product called
> ZPhotoAlbum which subclasses a ZCatalog to provide full-text, indexed
> searches on your online photo database.
Well, it's not exactly an online photo database that I was making per se, but
I guess once it's out I'll see whether it would suffice.
> This should work:
> <dtml-var "blah(REQUEST, class='fooimage', alt='[Can't use dtml tags inside
> dtml tags]', pdcookie='1')">
Zope spits out the following:
Expression (Python) Syntax error:
invalid syntax
, for tag <dtml-var "blah(REQUEST, class='fooimage', alt='[Can't use dtml tags
inside dtml tags]', pdcookie='1')">, on line 6 of index_html
It gives the same error if I use the other version.
> Let me know right away if this doesn't work for you.
The *major* problem I am suffering is that I don't know what "blah" is in my
method, so the above doesn't work.
The ZClass FooImage has a property "image".
Inside the image property for a given instance, I stick the ID of the proper
photo object.
My DTML is in the index_html method of FooImage.
I don't know how to tell DTML to grab the object referred to by "image" (as
opposed to the string CONTENTS of the "image" property, which is what it does
right now, I assume). If I just plug in the Property name as in
"image(REQUEST", then it gives a "call of non-function" error.
> > Alternately, figuring out how to use this "pdcookie" feature from a normal
> > <img> tag would work too.
> >
> Actually, you don't need the pdcookie feature at all. The photo object
> ALWAYS checks for the presence of its cookie, if it finds it, it will render
> to the preferred size, unless overridden by dtml.
I wasn't very clear, and I realized it right after I sent the email. I want
to display the little HTML menu for setting the pdcookie.
> Yes. I imagine it would be. That seems to be the rub of object-oriented
> programming, trying to build software that mimics that objects that we
> experience in real life. I doubt I would figure it out either.
Well, I always understood OOP to be based on that principle. Inherit from an
object to get the functionality of the object. Zope seems to make that rather
difficult.
> Actually, I don't know which packaging scheme is better, package PIL with
> Photo or package PIL outside Photo. I know of several products tthat require
> this. Photo, Poll, Dataminer, and a couple that I can't remember the name
> of...
Put up a version with and a version without PIL, and let users decide which
they need. Or put up a version of PIL that automatically decompresses to the
right location, but is still a separate file.
> Sure, but I need a 128x128 size.
Yup. I changed the preview size to 128x128, and shrunk thumbnail to 32x32
(though that may be TOO small. Maybe 48x48 would be better).
> Actually, I have had many people request to set their default WITHOUT
> editing the source.
I was gonna suggest that too, but I figured my post was long enough, and I
thought you were already aware of it. ;-)