[Zope] Inheriting Image Classes in ZClasses?

Dianne Van Dulken Dianne.VanDulken@team.ozemail.com.au
Tue, 5 Mar 2002 10:49:36 +1100


Hi All, 

First of all, I'd like to thank everyone who helped me with my
auto-cataloging thing.  That is working beautifully now.  

Onto my new problem.  I am trying to set up an image subclass for a
particular project that I am on.  As well as the normal image properties, it
has things like alt, display height, copyright, etc.

I've set up a ZClass called OPImage.  The problem I am having is actually
defining it to be a subclass.  I can add items matching this class, but
whenever I go to edit them, it brings me up to the standard image edit,
which, of course, ignores all of the new properties I have set.  I have my
own edit form set up as the first option in the views tag for the
propertysheets for this class.

The code I have for adding an item of this class is:

<dtml-with expr="REQUEST.form">
<dtml-call "manage_addImage(objectname, file, title=thetitle)">
<dtml-with "_.getitem(_['objectname'])">
<dtml-call "manage_addProperty('alt', alttag, 'string')">
<dtml-if expr="dheight == ''">
<dtml-call "manage_addProperty('dheight', height, 'string')">
<dtml-else>
<dtml-call "manage_addProperty('dheight', dheight, 'string')">
</dtml-if>
<dtml-if expr="dwidth == ''">
<dtml-call "manage_addProperty('dwidth', width, 'string')">
<dtml-else>
<dtml-call "manage_addProperty('dwidth', dwidth, 'string')">
</dtml-if>
</dtml-with>
</dtml-with>

(If there is something awful there, please let me know as I am new to Zope)

It is pretty obvious to me that the manage_addImage is causing the problem,
but I can't work out how else to set it, or how exactly I define this to be
a subclass of the Image class.  I've looked through the archives, and can
see it CAN be done, but no hints as to how.

Help!

Thanks very much

Di