[Zope3-dev] Re: run-time adapter registration and un-registration

Philipp von Weitershausen philipp at weitershausen.de
Tue Feb 13 05:11:11 EST 2007


Chris,

(wrong list, btw... such posts belong on zope3-users at zope.org)

> I'd like to build a UI that allows a user to changing what adapters 
> (views in particular) are assigned to an interface through a web interface.
> 
> The sounds like it's going to require runtime assigned and un-assignment 
> of adapters.
> 
> Has anyone tried this before?

Well, we do it all the time with persistent, local components (not 
necessarily with adapters but with utilities). I can't recommend 
manipulating the global registries at runtime because such changes would 
be lost after a restart. Volatile registries such as the glboal one are 
best populated during startup (by ZCML, grok, etc.) and then left alone. 
Manipulating local, perisstent registries is quite simple (the API is 
the same, see zope.component.interfaces.IComponents).


-- 
http://worldcookery.com -- Professional Zope documentation and training
Next Zope 3 training at Camp5: http://trizpug.org/boot-camp/camp5


More information about the Zope3-dev mailing list