[Zope3-dev] Re: Can an adapter find out what name it
was registered for?
Chris Withers
chris at simplistix.co.uk
Mon Nov 27 11:04:37 EST 2006
Stephan Richter wrote:
> On Friday 17 November 2006 03:43, Chris Withers wrote:
>> What do you suggest I do when the adapter needs to know the name it was
>> registered for?
>
> You can make the name part of the adapter API.
Not sure what you mean by this?
> However, I would suggest revising the design; I have never come across a
> scenario where I wanted the name of the adapter be known within the adapter.
> This seems to be a recipe for trouble.
I don't think it'll be a common pattern, but it doesn't feel right to me
that a named adapter (ie: one registered with a specific name) has no
way of finding out what name it has been registered with...
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
More information about the Zope3-dev
mailing list