[Twisted-web] docFactory at Nevow Elements

Juanjo Conti jjconti at gmail.com
Wed Oct 7 14:39:55 EDT 2009


Can I change doc_factory in the __init__ method of MyLiveElement?

2009/9/30 Juanjo Conti <jjconti at gmail.com>:
> Any document about how does docFactory actually work?
>
> 2009/9/30 Juanjo Conti <jjconti at gmail.com>
>>
>> 2009/9/30 Juanjo Conti <jjconti at gmail.com>
>>>
>>> 2009/9/30 <exarkun at twistedmatrix.com>
>>> [snip]
>>>>
>>>> There's also nevow.loaders.xmlstr.
>>>>
>>>> You may not want to bother making a new docFactory for every page
>>>> render, though.  You might want to make a single render function and
>>>> return the string from that, wrapped in nevow.tags.xml.
>>>>
>>>
>>> Excelent!
>>>
>>> docFactory = loaders.stan(T.xml(render_to_string('ter.html', {})))
>>
>> Not so fast.
>>
>> This 2 lines donot generate the same page :(
>>
>> docFactory = xmlfile(sibpath(__file__, 'ter.html'))
>> docFactory = loaders.stan(T.xml(render_to_string('ter.html', {})))
>>
>> --
>> Juanjo Conti
>> blog: http://www.juanjoconti.com.ar
>
>
>
> --
> Juanjo Conti
> blog: http://www.juanjoconti.com.ar
>



-- 
Juanjo Conti
blog: http://www.juanjoconti.com.ar



More information about the Twisted-web mailing list