Cyril Elkaim wrote:

> This script works fine if I test it inside the test tabs of the zclass. But
> if I run it from an instance 'container.objectItems()' returns nothing. I 
> understand why but my problem is how to get access of the images from
> the instance.
> What I need is something giving a reference to the zclass definition from
> one of its instance. I think I can use the DOM model and walk through until
> I find it but it should be better to have a direct access from the instance
> itself, wrong?

>From an external method, you can do




to get the attributes of your class.

 From a PythonScript, you can use something like


to get a reference to the ZClass definition.

You should also be able to use this:


I suggest you make a PythonScript or external method in your ZClass 
definition called list_attributes, that returns a list of the attributes 
of the ZClass definiton. Your other methods can call that.
That way, if you change the Product of your ZClass in the future, you 
only have one thing to alter (should you choose the PythonScript).

I advise against using an external method for this, as (if you're not 
careful) it may return unwrapped objects, which is a security hazard.

Steve Alexander
Software Engineer
Cat-Box limited

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to