[ZPatterns] DataSkin: attributes defined in a class

Ulrich Eck ueck@net-labs.de
Fri, 13 Jul 2001 20:26:05 +0200


> 
> Not always.  Only if another provider (such as a SkinScript declaration or 
> a ClassExtender) doesn't provide a value for the 
> attribute.  "class_default_for_%s" is a last resort, and it's there to work 
> around the fact that in normal Python you can't override attributes which 
> already exist in your dictionary or class.
> 

so I use it in the right way when I define e.g.

class myDSClass(DataSkin,Item):
   """ a dataskinclass that can be used as a base for a ZClass"""

    class_default_for_manage_options = (something,)
...

because of the ZClasses __init__ does copies the manage_options
to the newly created ZClass and produces an Error (loop over non-sequence)
if I would have defined it directly in the class as Attribute with that name.

Thanks !

ulrich eck