[Twisted-web] On Flatteners and Adapters
Pedro Sanchez
psanchez at nortel.com
Fri Aug 19 17:14:34 MDT 2005
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'>.
Locals
flattener
None
obj
<Menu object at 0xb76dd42c>
context
WovenContext(tag=Tag('li',
children=[<Menu object at
0xb76dd42c>]))
I'm using http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286260
as a reference for this sample implementation. The idea is to define two
objects, Menu and MenuItem, and then to define and to register adapters
for each object type.
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
PS. I test the program running:
$ twistd -noy menu.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: menu.py
Type: text/x-python
Size: 1791 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050819/db8e7765/menu.py
More information about the Twisted-web
mailing list