[Zope] How to access the attributes of a base class?

Stefan H. Holek stefan@epy.co.at
Sat, 06 Apr 2002 13:19:13 +0200


At 05.04.2002 18:06 +0200, Lars Heber wrote:

>hans wrote:
>
> > Lars Heber wrote:
> >
> > > Hello,
> > > I have a ZClass Folder and a ZClass SpecialFolder, which has Folder as
> > > base class.
> > > Within an instance of SpecialFolder, I need access to a property
> > > declared in the base class Folder.
> > > Alternatively, I could create a property with the same name like that
> > > one from the base class, but this isn't allowed! BTW, it would be nice
> > > if this was possible in order to hide the original value - iirc this is
> > > usual in object oriented contexts.
> > >
> > > Does anybody have a suggestion how to do it via DTML?
> >

With ZClasses you will have to give different names to the propertysheets 
in order to be able to access a base class' properties. You can then do 
something along the lines of (untested):

<dtml-var "propertysheets.baseClassSheet.aProperty">
<dtml-var "propertysheets.thisClassSheet.aProperty">

HTH,
Stefan

--
BLOWFISH n. - Preference for beef