[Zope] runtime error when creating selection property from function
Chris Leonello
cleonello at yahoo.com
Tue Oct 28 13:16:15 EST 2003
HI,
I don't know if this is the correct list, but here goes. I have written a
custom python product and recieve the following error when I try to view
the "Properties" page:
Error Type: RuntimeError
Error Value: function attributes not accessible in restricted mode
The source of the error is a selection property I have defined in
_properties like so:
{'id':'data_source', 'type':'selection', 'mode': 'w',
'select_variable':'getDataSources'}
Directly following my _properties definition in the class, I have the
getDataSources method:
def getDataSources (self):
"""
Get the sources (methods, queries, etc.) that we can pull data from.
"""
ds = []
for item in self.superValues(('DTML Method', 'External Method',
'Script (Python)', 'Z SQL Method')):
ds.append(item.id)
return ds
More specifically, the error stems from the call to self.superValues(...)
in the for loop. If I comment out the for loop and manually populate the
ds list, it works fine. It also works fine if I change the
'type':'selection' to 'type':'multiple selection' in the _properties
definition.
I am running Zope 2.6.1 on Windows ME with Pyton 2.1.3. Why does Zope
think I am runnng in restricted mode when I make this call? Why does this
work for multiple selection but not selection types?
Any help/suggestions are greatly appreciated. Thanks!
=====
Chris Leonello
cleonello at yahoo.com
__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/
More information about the Zope
mailing list