Emyr Thomas, on 2007-08-13:
> def appname():
> def get(self):
> return self.mapping['appname']
> def set(self, v):
> self.mapping['appname'] = v
> return property(get, set)
> appname = appname()
I think you need to do "appname = self.appname()" here. Or "appname =
appname(self)". But I tend to do it like this:
def __get_appname(self):
return self.mapping.get('appname', 'default string')
def __set_appname(self, v):
if not isinstance(v, str): # or unicode, whatever
v = float(v)
self.mapping['appname'] = v
appname = property(__get_appname, __set_appname)
(partly copied from another project, so I may have overlooked something)
> Also, when zope starts up, I get this warning:
>
> 2007-08-13 10:24:09 WARNING Init Class
> Products.PloneSoftwareCenter.content.release.PSCRelease has a security
> declaration for nonexistent method 'appname'
The problem here is that this class implements your interface so due
to the zcml it has a security declaration for 'appname', but it does
not have a method 'appname' as you define it as an attribute, which
makes it not available on Zope startup. This can safely be ignored.
--
Maurits van Rees | http://maurits.vanrees.org/ [NL]
Work | http://zestsoftware.nl/
"Do not worry about your difficulties in computers,
I can assure you mine are still greater."
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers