[Twisted-web] validating nevow disk templates

Phil Mayers p.mayers at imperial.ac.uk
Fri Feb 23 19:12:22 CST 2007

L. Daniel Burr wrote:
> Generally, I try to avoid working to please markup validators, but that
> may just be me ;)

I don't aim to please them. But I do aim to meet the standards.

> <input type="text" nevow:render="foo" />

IMHO excessive use of render methods leads to madness. I try very hard 
to make my render methods markup-unaware. Most of them read like:

tag = context.tag
thing = tag.patternGenerator('thing')
for item in data:
    this = thing()
    for k,v in item.items():
        this.fillSlot(k, v)
return tag

i.e. all that render does is compose patterns and fill slots. Hence I 
like having the values of attributes as slots.

>> I like stan, but I dislike the fact that it clutters up .py files and 
>> also that it doesn't reload like the disk templates. OTOH I deeply 
>> dislike the nevow:attr / nevow:slot pseudo-tags in the disk templates.
> Sounds like you won't be happy either way ;)  Fortunately, something

Well, I did not mean to give that impression. I would not be spending 
time on Twisted+Nevow if it didn't make me happy.

> like what I suggested above should work for your stated case, and

Sorry, but I like using a bazillion render methods merely to set 
attributes even less!

If the answer is "you can't pretty-indent xmlfile templates and still 
have them validate" that's fine.

Thanks for the feedback.

More information about the Twisted-web mailing list