Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-30 Thread Chris Withers
Dieter Maurer wrote: The "str" example shows also that it is not sensible that the adapter registry framework gives the adapter (factory) a way to determine its name ("str" has nothing where the "name" could be sticked in). True enough, I guess I'll just have to stick with my hack or Tres' cur

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-29 Thread Dieter Maurer
Chris Withers wrote at 2006-11-28 18:09 +: >Benji York wrote: >> Chris Withers wrote: >>> 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

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-29 Thread Wichert Akkerman
Previously Stephan Richter wrote: > On Wednesday 29 November 2006 03:37, Wichert Akkerman wrote: > > The fact that something is true in Zope 3 does not necessarily make it a > > good idea. > > But the chances are pretty high! ;-) Of course I meant to say 'Zope 2' there, which does reduce the chan

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-29 Thread Stephan Richter
On Wednesday 29 November 2006 03:37, Wichert Akkerman wrote: > The fact that something is true in Zope 3 does not necessarily make it a > good idea. But the chances are pretty high! ;-) Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-29 Thread Wichert Akkerman
Previously Chris Withers wrote: > Really? Certainly in Zope 2, prettymuch every persistent objects needs > to be getId()'able... The fact that something is true in Zope 3 does not necessarily make it a good idea. Wichert. -- Wichert Akkerman <[EMAIL PROTECTED]>It is simple to make things.

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-29 Thread Chris Withers
Benji York wrote: Really? Now this is a use case I hadn't thought of.. can you give me some examples of where you've run into this? I don't know that I have, but the component system doesn't preclude it so anything we come up with will have to take it into effect. I'll whisper yagni at this

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-28 Thread Paul Winkler
On Tue, Nov 28, 2006 at 06:12:19PM +, Chris Withers wrote: > 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? There's always a way :) You could just do what the directive does - call the adapt

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-28 Thread Benji York
Chris Withers wrote: Benji York wrote: Chris Withers wrote: 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... Because the same adapter can be

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-28 Thread Chris Withers
Benji York wrote: Chris Withers wrote: 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... Because the same adapter can be registered more tha

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-27 Thread Stephan Richter
On Monday 27 November 2006 11:17, Benji York wrote: > This seems somewhat analogous to a Python object being given multiple > names.  In that case too, there is no way for the object to know what > it's names are. Great analogy. I used that one before too, but did not think of it this time. Regar

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-27 Thread Benji York
Chris Withers wrote: 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... Because the same adapter can be registered more than once, it would a

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-27 Thread Chris Withers
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;

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-25 Thread Stephan Richter
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. However, I would suggest revising the design; I have never come across a scenario where I wanted the n

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-17 Thread Philipp von Weitershausen
Chris Withers wrote: Philipp von Weitershausen wrote: Chris Withers wrote: Can a named adapter find out the name it was registered with during the adaptation process? Nope. I can see why it's that way, but it seems a shame and maybe even an oversight :-/ What do you suggest I do when the

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-17 Thread Chris Withers
Philipp von Weitershausen wrote: Chris Withers wrote: Can a named adapter find out the name it was registered with during the adaptation process? Nope. I can see why it's that way, but it seems a shame and maybe even an oversight :-/ What do you suggest I do when the adapter needs to know