[Zope-dev] urg

Tom Deprez tom.deprez@uz.kuleuven.ac.be
Tue, 07 Mar 2000 09:55:04 +0100


Damn, I'm loosing my faith in Zope. I'm already 3 days trying to find a
solution, but I'm still at the same place as I was 3 days ago. This isn't
funny anymore.

You're my last resort, I hope someone can help.

I'm trying to create a ZClass which updates some properties when it is
added or moved. Now, people pointed me to the manage_afterAdd method. And
indeed, when I use this code  (as an external method) :

def manage_afterAdd(self,item,container)
   item.myparent=container.id
   return

it works when I don't have a class which inherits from CatalogAware Class.
However, it doesn't works with a class inherited from CatalogAware Class.
Probably because the manage_afterAdd method is defined in the CatalogAware
Class.

So I tried to modify the external method to :

def manage_afterAdd(self,item,container)
   item.myparent=container.id
   CatalogAware.manage_afterAdd(self,item,container)
   return

But then I get following error when adding an instance of the new class :

Zope Error

           Zope has encountered an error while publishing this resource. 

           Error Type: NameError
           Error Value: CatalogAware

           Troubleshooting Suggestions

                This resource may be trying to reference a nonexistent
object or variable
                CatalogAware. 
                The URL may be incorrect. 
                The parameters passed to this resource may be incorrect. 
                A resource that this resource relies on may be encountering
an error. 


Urgh, I'm really desperate. Do you know what I'm doing wrong?

ps. Why does this function has to be an external method? Is it also
possible with an DTML method?

Regards, Tom.