[Zope] runtime error when creating selection property from function

Chris Leonello cleonello at yahoo.com
Tue Oct 28 13:16:15 EST 2003


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',

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')):

    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

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

More information about the Zope mailing list