[Zope3-dev] Choice field vocabulary

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Oct 18 09:07:56 EDT 2005


On Monday 12 September 2005 15:39, Fernando Correa wrote:
> I have a content type where I'm storing some information. So I create
> another content type with a Choice field where it's vocabulary should
> be all objects name of the fist one.
> I've read how to populate a vocabulary with the content of a file, or
> even the content of a folder.
> What the best way to create a vocabulary witch its content is a specific
> object?

You cannot really control the context of a vocabulary well, i.e. it is 
different during creation versus editing. However, you can always get the 
site

zope.app.component.hooks.getSite()

and traverse to the desired folder from there. Another alternative would be to 
use the IntId utility or even an index.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-dev mailing list