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)
   tag[this]
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.

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

Reply via email to