[ZPatterns] Re: HowTo: Make an Image/File a DataSkin ???

Ulrich Eck lists@net-labs.de
Wed, 11 Jul 2001 14:26:20 +0200


> 
> Actually, I'm not sure you need to do anything special at all.  If you use 
> the File DataSkin in a Folder w/Customizer Support, you shouldn't need to 
> do anything special, because in that mode the 'id' attribute is never used 
> by ZPatterns. 

What is the right way to extend an existing Class with DataSkin functionality ?

myclass(DataSkin,otherclass):
or 
myclass(otherclass,DataSkin):

there are often Problems with the __init__ functions that assign attributes of the
new instance were no DataManager is availiable ..

usually I would do a:

def addMyClass(id):
    ob = myclass(id)
    ob = ob.__of__(self)         # need this for the DataManager
    ob._setup_this_instance(<myattributes>)
    self._setOb(id,ob)

and in my classes _setup_this_instance(...)
    otherclass.__init__(<myattributes>)

is this the right way to do it ??

thanks for your help

Ulrich Eck