[Zope3-dev] Re: Can an adapter find out what name it was registered
for?
Chris Withers
chris at simplistix.co.uk
Tue Nov 28 13:12:19 EST 2006
Tres Seaver wrote:
> for name in ('vindaloo', 'madras', 'tiki_masala'):
> globals()[name] = MNA_factory_maker(name)
>
> and then in ZCML:
>
> <adapter for=".interfaces.IChicken"
> provides=".interfaces.ICurry"
> name="vindaloo"
> factory=".adapters.vindaloo" />
...but here you have to specify the same info twice and hence duplicate
info and get it identical in two places, which feels icky to me.
Is there a python-only way to register adapters instead of in ZCML and,
if it exists, is it safe to use in conjunction with the normal zcml dances?
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
More information about the Zope3-dev
mailing list