Ian Bicking: the old part of his blog

Re: On form libraries

I am in total agreement about form generation libraries, and this was something i didnt like about early FormEncode. This is because ive been building forms with all kinds of server side languages for a really long time, and have many times gone down the road of building "generic form generation" systems, as well as using a lot of the early losers like ATG dynamo and stuff like that. its the same 80% solution tune that plays all day long...or at least 80% of the time.

Fortunately for me, I always worked in environments where the non-feasability of form generators was always super-obvious: id get handed enormous HTML redesigns of my forms from designers and had to work around that.

Still, the need to have the ability to just say, "text input element!" somewhere on a page without going through the motions of the repeating the individual HTML and site-specific customizations of that element, is very important. thats why I was so apeshit over HTML::Mason, and then Myghty, and upon Myghty crumbling under its own weight I reimplemented it as Mako: you need to be able to make custom, reusable, nested, inter-aware widgets, in straight templated HTML, immediately.

so ill keep saying it like i always do: the "templating" part is not so hard. With Mako, you create any number of templates containing your widgets as <%defs>, and then you can <%call> them, using whatever nesting schemes you desire. It really works frigging great...its the model ive used for years and component-call-with-content is the "killer feature" of these systems. Its the ability to create custom nestable tags without any python code or external modules. no other template lang ive seen in python can really do this (except myghty of course).

I have been playing with toscawidgets for a gig recently, and its OK but its the same thing. Theyre making me put HTML in my source code, making me dispatch it through confusing classes and datastructures...and thats just not where it belongs.

Comment on On form libraries
by mike bayer

Comments:

Mike, care to add a howto to docs.pythonweb.org about form generation with Mako?

# Max Ischenko