[Twisted-web] fragments with child lookup

Markus Schiltknecht markus at bluegap.ch
Sun Sep 24 11:35:48 CDT 2006


Jean-Paul Calderone wrote:
> I don't know what "component based" means.  In any case, you cannot render
> a Page as part of another Page.  You should probably pretend that Page does
> not subclass Fragment, because that is only an implementation detail.  If
> you want to nest renderable objects, you should use Fragments (or Elements)
> directly, not Pages.

I don't mind if I have to use Pages or Fragments. The point is: I don't 
know how to do it with nevow.

I've been experimenting and came to think about using WSGI for what I want:

* A normal nevow page as a container, which has any type of docFactory. 
Then it provides a 'render_content', which fires a WSGI request.

* A 'child fragment', which gets 'exported' via WSGI, and which can then 
be included as part or fragment of the above container.

Of course not all applications can be embedded into another page, for 
some it doesn't even make sense, but for others, a whole lot of new 
possibilities are opened.

WSGI probably has the advantage that it's standard and AFAIK some sort 
of 'child' already exists in nevow/wsgi.py. I don't know if WSGI plays 
that well with deferreds, though.

Regards

Markus



More information about the Twisted-web mailing list