[ZPatterns] ZPatterns not TTW, step 2

Phillip J. Eby pje@telecommunity.com
Mon, 11 Jun 2001 08:31:44 -0500


At 10:55 PM 6/10/01 -0500, Steve Spicklemire wrote:
>
>Ach.. I see. I went back to the code that did this.. and I had forgotten 
>that while it was a "Python Product" that subclasses from DataSkin, it 
>was also a registered base class for ZClasses, and I had subclassed a 
>ZClass from it to use in the StorageTab. But in looking at the running 
>App I see that my base
>classes show up in the Storage popup as being usable classes for the 
>Rack. Maybe all you need is to register you classes as a base class and 
>the rest of the magic will work? ;-)
>

It should, as the Storage tab queries both Python ZClass bases *and*
ZClasses (note the "unified ZClass registry" references).  So you should be
able to just register a Python class and have it work.  The main thing is
just that the _v_itemConstructor attribute needs to be a class.  It doesn't
persist, however, so you really need to set Rack._zclass or
Rack._defaultClass.  You can set these to Python classes directly in Python
code, but then the Storage tab won't work properly.  It's best to just
register your class as a ZClass base, because then someone using your
product can always create a subclass and change the Rack to use it.