[Twisted-web] Formless, custom form layout

Ian Bicking ianb at colorstudy.com
Thu Jun 30 11:07:14 MDT 2005


Matt Goodall wrote:
> forms, by comparison, is not about object interfaces; it's about
> explicitly creating a Form, adding fields to it, rendering it, and
> processing it (with validation). Because forms is only interested in
> HTML, it also allows a field's widget to be switched easily, without
> having to create a new Typed subclass. For instance, I can add a Date
> field to a forms form and choose to render that as a text input, three
> inputs (dd/mm/yyyy) or even a <select> list of predefined dates, just by
> changing the widget.

I might encourage you to think about using the architecture I describe 
here: http://blog.ianbicking.org/a-theory-on-form-toolkits.html -- 
either using FormEncode, pieces, or just the general idea.  E.g., I 
think something like FormEncode's htmlfill that used stan could be 
useful, and FormEncode doesn't currently include anything very good for 
actual HTML generation.

Anyway, I think keeping the parts separate (blank HTML form generation, 
validation, final form rendering) is really important to making a usable 
system; without it people just keep creating form toolkits that they 
later come to hate because the abstraction boundaries don't fit the 
actual development process.

-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org



More information about the Twisted-web mailing list