[Zope] ZClass direct variable access

Casey Duncan cduncan@kaivo.com
Mon, 19 Mar 2001 08:20:30 -0700


Phill Hugo wrote:
> 
> Is there a way to access property sheet variables from a zclass method
> without knowing which property sheet it is contained within.
> 
> For example, Class A has two prop sheets, S1 and S2 and Var1 is in S2.
> 
> I can do container.propertysheets.get('S2').getProperty('Var1')
> 
> or (if I has subclassed ObjectManager)... container['Var1']
> 
> The latter form I prefer since it doesn't require knowledge of which
> sheet I'm really using but it only works if the zclass is based on
> ObjectManager. In other cases it raises an exception (AttributeError,
> __getitem__)
> 
> Any ideas or should this be added to the collector (I've a feeling a
> basic __getitem__ should be included in ZObject for this type of thing).
> 
> Phill
> 

You can't just do a "S2.Var1" to access the property?

-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>