
Hello, "DON'T USE THE CONTEXT" has been in the #twisted.web topic for some time. I've heard that the context is being removed from Nevow. * Why is the context being removed? * What should I use instead of the context to get at ctx.tag? * How does nevow:data stuff work in a world without context? * nevow-rendering.txt should be updated. It currently recommends that people use the context. cheers, jml

On Thu, 12 Oct 2006 17:45:40 +1000, Jonathan Lange <jml@mumak.net> wrote:
Hello,
"DON'T USE THE CONTEXT" has been in the #twisted.web topic for some time. I've heard that the context is being removed from Nevow.
* Why is the context being removed?
- It causes buggy software to be written - It causes complex software to be written - It causes rendering to be O(N ** N) in memory and CPU
* What should I use instead of the context to get at ctx.tag?
nevow.page.Element has a render dispatcher which passes the request and the tag to render methods.
* How does nevow:data stuff work in a world without context?
I don't know. It doesn't so far.
* nevow-rendering.txt should be updated. It currently recommends that people use the context.
Patches accepted, etc (please convert it from rest to lore too :( ). Jean-Paul

On 10/12/06, Jean-Paul Calderone <exarkun@divmod.com> wrote:
On Thu, 12 Oct 2006 17:45:40 +1000, Jonathan Lange <jml@mumak.net> wrote:
* How does nevow:data stuff work in a world without context?
I don't know. It doesn't so far.
Will it?
* nevow-rendering.txt should be updated. It currently recommends that people use the context.
Patches accepted, etc (please convert it from rest to lore too :( ).
I don't understand Nevow enough. Anyway, isn't the target a little mobile? cheers, jml

On Thu, 12 Oct 2006 22:43:28 +1000, Jonathan Lange <jml@mumak.net> wrote:
On 10/12/06, Jean-Paul Calderone <exarkun@divmod.com> wrote:
On Thu, 12 Oct 2006 17:45:40 +1000, Jonathan Lange <jml@mumak.net> wrote:
* How does nevow:data stuff work in a world without context?
I don't know. It doesn't so far.
Will it?
Don't know that, either. Convince me. :)
* nevow-rendering.txt should be updated. It currently recommends that people use the context.
Patches accepted, etc (please convert it from rest to lore too :( ).
I don't understand Nevow enough. Anyway, isn't the target a little mobile?
Include tests that fail when it gets out of date. I'll make sure they keep passing. :) Jean-Paul

On 10/12/06, Jean-Paul Calderone <exarkun@divmod.com> wrote:
On Thu, 12 Oct 2006 22:43:28 +1000, Jonathan Lange <jml@mumak.net> wrote:
On 10/12/06, Jean-Paul Calderone <exarkun@divmod.com> wrote:
On Thu, 12 Oct 2006 17:45:40 +1000, Jonathan Lange <jml@mumak.net> wrote:
* How does nevow:data stuff work in a world without context?
I don't know. It doesn't so far.
Will it?
Don't know that, either. Convince me. :)
Allow me to question your answer with a question: How does one render a sequence without nevow:data directives? <ul n:data="foo" n:render="sequence"> <li n:pattern="item"> <n:invisible n:data="name" n:render="string"/> </li> </ul>
* nevow-rendering.txt should be updated. It currently recommends that people use the context.
Patches accepted, etc (please convert it from rest to lore too :( ).
I don't understand Nevow enough. Anyway, isn't the target a little mobile?
Include tests that fail when it gets out of date. I'll make sure they keep passing. :)
I appreciate that. Maybe I'll hold you to it. :) However, if I don't know the right way to build a list of things, then it's going to be an useless document. cheers, jml

On Fri, 13 Oct 2006 09:00:54 +1000, Jonathan Lange <jml@mumak.net> wrote:
On 10/12/06, Jean-Paul Calderone <exarkun@divmod.com> wrote:
On Thu, 12 Oct 2006 22:43:28 +1000, Jonathan Lange <jml@mumak.net> wrote:
On 10/12/06, Jean-Paul Calderone <exarkun@divmod.com> wrote:
On Thu, 12 Oct 2006 17:45:40 +1000, Jonathan Lange <jml@mumak.net> wrote:
* How does nevow:data stuff work in a world without context?
I don't know. It doesn't so far.
Will it?
Don't know that, either. Convince me. :)
Allow me to question your answer with a question: How does one render a sequence without nevow:data directives?
<ul n:data="foo" n:render="sequence"> <li n:pattern="item"> <n:invisible n:data="name" n:render="string"/> </li> </ul>
Perhaps like this: <n:invisible n:render="foo_sequence" /> Combined with this: def foo_sequence(self, req, tag): return Sequence(foo) Jean-Paul

Jean-Paul Calderone wrote:
Allow me to question your answer with a question: How does one render a sequence without nevow:data directives?
<ul n:data="foo" n:render="sequence"> <li n:pattern="item"> <n:invisible n:data="name" n:render="string"/> </li> </ul> Perhaps like this:
<n:invisible n:render="foo_sequence" />
Combined with this:
def foo_sequence(self, req, tag): return Sequence(foo)
Jean-Paul
I didn't understand, and I can't find so much informations on internet: in the future the "n:data" will be not available? This will be the only modification? And the python rendering functions will be always "render_func(self, ctx, data) ? Thanks Alessandro

On Wed, 18 Oct 2006 06:45:46 +0200, Alessandro <aleuser@inwind.it> wrote:
Jean-Paul Calderone wrote:
Allow me to question your answer with a question: How does one render a sequence without nevow:data directives?
<ul n:data="foo" n:render="sequence"> <li n:pattern="item"> <n:invisible n:data="name" n:render="string"/> </li> </ul> Perhaps like this:
<n:invisible n:render="foo_sequence" />
Combined with this:
def foo_sequence(self, req, tag): return Sequence(foo)
Jean-Paul
I didn't understand, and I can't find so much informations on internet: in the future the "n:data" will be not available?
This is not yet decided.
This will be the only modification?
Likely there will be others :)
And the python rendering functions will be always "render_func(self, ctx, data) ?
New render functions will probably take a request object and a tag object. All of these API changes will be introduced gradually and with either a backwards compatibility API or a long period of deprecation warnings for the old API before the old API stops working. Jean-Paul

* Jonathan Lange <jml@mumak.net> [2006-10-13 09:00:54 +1000]:
Allow me to question your answer with a question: How does one render a sequence without nevow:data directives?
<ul n:data="foo" n:render="sequence"> <li n:pattern="item"> <n:invisible n:data="name" n:render="string"/> </li> </ul>
I generally just do something like this: <ul n:render="products"> <li n:pattern="item"> <n:slot name="name" /> </li> </ul> The "products" renderer is then implemented by handing the relevant data to a helper function. -- mithrandi, i Ainil en-Balandor, a faer Ambar
participants (4)
-
Alessandro
-
Jean-Paul Calderone
-
Jonathan Lange
-
Tristan Seligmann