[Twisted-web] nevow CannotAdapt error

Justin Johnson twisted-web@twistedmatrix.com
Fri, 12 Dec 2003 07:36:02 -0600


Some of the confusion is probably because I had it incorrect in the doc. 
I updated it yesterday to say something like:

    document = xml("some html")

instead of:

    document = "<xml>some html</xml>"


On Thu, 11 Dec 2003 23:43:31 -0500, "Donovan Preston" <dp@divmod.org>
said:
> 
> On Dec 11, 2003, at 11:24 PM, Kevin Howe wrote:
> 
> > I'm trying to run a simple nevow test:
> >
> > from nevow.renderer import Renderer
> > class MyRenderer(Renderer):
> >     document = """<xml>test</xml>"""
> > m = MyRenderer()
> >
> > But get the following traceback?
> 
> <snip cannot adapt>
> 
> Are you using cvs? If you use CVS HEAD, you might find that this 
> problem goes away. Otherwise, you'll need to import atop.regadapt and 
> call justDoIt to register the adapters.
> 
> Also, note that your document is a simple python string, but has xml in 
> it. Nevow quotes normal python strings, so if you want it to go through 
> as straight xml, you should wrap it in a stan.xml object first.
> 
> dp
> 
> 
> _______________________________________________
> Twisted-web mailing list
> Twisted-web@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web