[Zope] ZClasses and clone/delete methods

John Morton jwm@plain.co.nz
Tue, 21 Mar 2000 15:51:25 +1200 (NZST)


I need to know whether I can set up clone and delete methods in a
Zclass that automatically get invoked any time someone deletes or
copies an instance of that class from the management interface (via
cut and paste or whatever). 

What I'm doing is creating a simple link class that just stores the
key to a RDBMS row that contains all the details of the link
(description, URL, clickthrus etc). The trouble is that when a link is 
deleted from Zope, it needs to touch the db record or that record will 
become orphaned - ideally the db record needs to keep a reference
count of the number of link objects out their, and they need to
increment or decrement that count as they get copied and deleted.

So can this be done with a ZClass (if not, why not :-)) and if it
can't, how can I do this with a Python Product (given that I've never
written one!).

TIA,
John.