[Twisted-Python] Re: [Twisted-commits] adapter for DeferredList

Christopher Armstrong radix at twistedmatrix.com
Mon Jan 27 09:40:37 MST 2003


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/




More information about the Twisted-Python mailing list