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 -------------------------------------------------------------- Andy Heath, Senior Lecturer email: a.k.heath@shu.ac.uk o Sheffield Hallam University. Phone: +44 114 2534904 /\ Sheffield, England Fax: +44 114 2533161 () () --------------------------------------------------------------
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
participants (2)
-
Andy Heath -
Pavlos Christoforou