[Zope-dev] The Application object

Jeff K. Hoffman jeff.hoffman@goingv.com
Mon, 17 Jul 2000 14:51:47 -0400 (EDT)


On Mon, 17 Jul 2000, Chris McDonough wrote:

> How about a class attribute?
> 
> class MyClass:
> 
>     myAttr2 = 'Default'
> 
>     def getMyAttr1(self):
>         return self.myAttr1
> 
>     def getMyAttr2(self):
>         return self.myAttr2
> 
> If myAttr2 needs to be a ZClass instance, just grab it inside the class.

Again, it comes down to instantiation. I would need:

  class MyClass:

      myAttr2 = app.Control_Panel.Products.MyProduct.MyZClass('id')

and we're back to not having app, again.

Also, myAttr2 is volatile. Each instance of MyClass should have its own
instance of myAttr2; a class attribute would not give the desired
semantics.

I wish it were that easy.

Thanks,

--Jeff

---
Jeff K. Hoffman                               704.849.0731 x108
Chief Technology Officer                      mailto:jeff.hoffman@goingv.com
Going Virtual, L.L.C.                         http://www.goingv.com/