12 Mar
1999
12 Mar
'99
4:56 p.m.
On Fri, 12 Mar 1999, Andy Heath wrote:
I'm a zope newbie
I have an external method in which I want to check whether a property within zope exists and if it doesn't exist to create it.
How can I do this ?
Andy
If your external method is called from DTML document 'foo' then something like this should do it (untested): def mymethod(self): if not self.hasProperty('myproperty'): self.manage_addProperty('myproperty','hello','string') BTW you can achieve the same effect from DTML <!--# unless myproperty--> <!--# call "manage_addProperty('myproperty','hello','string')"--> <!--#/unless--> Pavlos