[Twisted-Python] Re: [Twisted-commits] adapter for DeferredList
![](https://secure.gravatar.com/avatar/9dc3e786cd4c51b63b5893ad009b0b70.jpg?s=120&d=mm&r=g)
On Thu, Jan 23, 2003 at 04:16:41PM -0600, itamarst CVS wrote:
Modified files: Twisted/twisted/web/woven/model.py 1.32 1.33
Log message: adapter for DeferredList
[..snip..]
components.registerAdapter(DeferredWrapper, defer.Deferred, interfaces.IModel) + components.registerAdapter(DeferredWrapper, defer.DeferredList, interfaces.IModel)
I know very little about Adapters, but shouldn't subclasses work automatically? Or is this too hard? -Andrew.
![](https://secure.gravatar.com/avatar/3a7e70f3ef2ad1539da42afc85c8d09d.jpg?s=120&d=mm&r=g)
On Mon, Jan 27, 2003 at 02:14:29PM +1100, Andrew Bennetts wrote:
On Thu, Jan 23, 2003 at 04:16:41PM -0600, itamarst CVS wrote:
Modified files: Twisted/twisted/web/woven/model.py 1.32 1.33
Log message: adapter for DeferredList
[..snip..]
components.registerAdapter(DeferredWrapper, defer.Deferred, interfaces.IModel) + components.registerAdapter(DeferredWrapper, defer.DeferredList, interfaces.IModel)
I know very little about Adapters, but shouldn't subclasses work automatically? Or is this too hard?
getAdapter takes an optional argument of a function to do the lookup, where the default does not look through the class hierarchy. You can pass an already-defined function, getAdapterWithInheritance, or something, which is in twisted.python.components, but I guess that's too slow to be the default. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | Release Manager, Twisted Project ---------+ http://twistedmatrix.com/users/radix.twistd/
participants (2)
-
Andrew Bennetts
-
Christopher Armstrong