[Zope] runtime error when creating selection property from
function
Chris Leonello
cleonello at yahoo.com
Thu Oct 30 08:30:00 EST 2003
--- Dieter Maurer <dieter at handshake.de> wrote:
> Chris Leonello wrote at 2003-10-28 10:16 -0800:
> > 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
>
> In the future, please post the traceback as well...
>
Will do.
> > ...
> > for item in self.superValues(('DTML Method', 'External Method',
> > 'Script (Python)', 'Z SQL Method')):
> > ds.append(item.id)
>
> Your problem almost surely is in the "id" above:
>
> For many objects "id" is a (string) attribute but for
> some (old) object types, it is a method.
>
> Never use "id" (unless you know precisely what you are doing).
> Always use the method "getId". I.e., your code should read:
>
> ds.append(item.getId())
>
That was it! Being very new to Python and Zope, I wasn't aware of the id
as sometimes a method sometimes an attribute. This is invaluable advice.
Thanks!
> --
> Dieter
=====
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