On Mon, 17 Jul 2006 15:18:13 -0200, Manlio Perillo <[EMAIL PROTECTED]> wrote:
    def render_option_list(self, ctx, data):
        option_list = [('1', 'uno'), ('2', 'due')]
        tag = ctx.tag

        pattern = inevow.IQ(ctx).patternGenerator("item")
        content = [pattern(data=option) for option in option_list]

        return ctx.tag.clear()[content]

This is very strange.

Not that much.

In my real application (that should be equivalent to this one, only
names changes), the whole <option> node is ignored!

Because you are never calling it. inevow.IQ(tag).patternGenerator('item') is
a much better way to get the pattern item.

Also the renderer you just wrote is basically the sequence renderer except not 
generic and fairly marginally faster if at all. Is there any valid reason for 
not using a better initial data structure to avoid rewriting the sequence 
renderer losing the reusability?

I can't understand why.

Don't use the context so intensely if you want to avoid weird things, understanding it takes considerable effort. The only thing the context is really still useful for is retrieving the tag and the request. Everything else can be done with one of those 2 things.




_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to