[Zope-dev] Python Product as DataSkin

Michael R. Bernstein webmaven@lvcm.com
Mon, 19 Feb 2001 19:10:03 -0800


Steve Alexander wrote:
> 
> Michael R. Bernstein wrote:
> 
> > Steve Alexander wrote:
> >
> >> Is the __init__ method of DataSkin getting called?
> >>
> >> This would happen if, for example, you define an __init__ method in your
> >> class, but you don't use something like:
> >>
> >> from Globals import default__class_init__
> >>
> >> default__class_init__(yourClass)
> >>
> >> At least, I *think* that's one of the things that default__class_init__
> >> does.
> 
> Nope... I got confused. Globals.default__class_init__ sets up the security
> attributes for you class, from whatever combination of security
> declarations you've used.
> 
> In Zope 2.3) it is aliased to Globals.InitializeClass.

So, if I'm developing this on 2.2, I need to use
Globals.default__class_init__(FooClass) instead of
Globals.InitializeClass(FooClass)?

> Use it by having
> 
>   import Globals
> 
> somewhere in your class definition,

If 'import Globals' appears at the start of the FooClass.py
file, does it still need to appear in the class definition
itself?

> and
> 
>   Globals.InitializeClass(YourClassName)
> 
> at the end.

At the end on the file, or the end of the class definition?

Thanks for the help,

Michael Bernstein.