[Twisted-web] On Flatteners and Adapters

Phil Frost indigo at bitglue.com
Fri Aug 19 17:29:19 MDT 2005


On Fri, Aug 19, 2005 at 07:14:34PM -0400, Pedro Sanchez wrote:
> Hello,
> 
> I'm trying to implement a menu with the attached code, but it fails with
> the following error:
> 
> exceptions.NotImplementedError: There is no flattener function
> registered for object <Menu object at 0xb76dd42c> of type <class
> 'Menu'>.
> 
> ...
> 
> I don't understand why it complains about flatteners not defined. Isn't
> that covered by the registered adapters? I'd appreciate any help.
> 
> Thank you,
> 
> -- 
> Pedro

It used to work like that. A while ago, a change was made to how
flatteners are registered; nevow.flat.registerFlattener is the new way
to do it:

from nevow import flat

class Bleh(object):
    pass

def flattenBleh(original, context):
    return 'a bleh thing'

flat.registerFlattener(flattenBleh, Bleh)



More information about the Twisted-web mailing list