[Zope3-dev] Re: Finding context in a vocabulary

Peter Mayne PeterMayne at ap.spherion.com
Fri Oct 1 02:13:26 EDT 2004


Stephan Richter wrote:
> You can go up the tree using zapi.getParent(obj). You have to inspect your 
> context manually and specifically for your use case to collect the data. Look 
> at the ManagableVocabulary code in the bug tracker for another advanced 
> example.

My vocabulary works fine. Thanks.

Along the way, after I chose a target for my reference, and selected 
"Add", I was getting

   File 
"/tmp/ZopeX3-3.0.0c1/build/lib.linux-i686-2.3/ZODB/serialize.py", line 
296, in _dump
UnpickleableError: Cannot pickle <type 'zope.security._proxy._Proxy'> 
objects

Looking at bugtracker's ManageVocabulary, I added

     context = removeSecurityProxy(context)

at the beginning of my __init__(), and things worked as I expected.

I'm not sure I understand what's going on here, and the handbook doesn't 
  go into removeSecurityProxy in any depth. Without the example of 
ManageVocabulary, I would have been lost at this point.

PJDM
-- 
Peter Mayne
Spherion Technology Solutions
Canberra, ACT, Australia
"You're given the form, but you have to write the sonnet yourself.
What you say is completely up to you." - Mrs. Whatsit



More information about the Zope3-dev mailing list