Hello,

I was wondering if it was possible to use htmlfill + kid? I was
thinking of something like this:

<!-- kid code -->

<form>

<span py:for="i in range(10)"><input name="foo-$i" type="text"
/></span>

<input type="submit" />

</form>

<!-- I WANT TO CALL:

htmlfill()

with the expanded HTML as the argument as follows below -->

<form>
<span> <input name="foo-0" type="text" /> </span>
<span> <input name="foo-1" type="text" /> </span>
<span> <input name="foo-2" type="text" /> </span>
<span> <input name="foo-3" type="text" /> </span>
<span> <input name="foo-4" type="text" /> </span>
<span> <input name="foo-5" type="text" /> </span>
<span> <input name="foo-6" type="text" /> </span>
<span> <input name="foo-7" type="text" /> </span>
<span> <input name="foo-8" type="text" /> </span>
<span> <input name="foo-9" type="text" /> </span>

<input type="submit" />

</form>
<
<!-- end -->


Is there an easy way of doing that? I don't want to use Myghty (it has
component calls /w content, true) because I am already using Kid and
I'd prefer to use one templating system so my designers don't get super
confused.

I thought about writing a filter, but then you'd have to add things to
cherrypy.request instead of passing in the errors/values to kid and
using htmlfill there.

I was hoping for something like

<form py:content="htmlfill(childcontent, error, values"> but I can't
figure out a way to get the "expanded" content of a tag. If anyone
knows how to do this, this would be greatly useful for everyone who
wants to do form validation without widgets.

I know I do, at least until widgets are more mature (right now they
don't even have containers!)

Reply via email to