Howdy! > I haven't talked about it much, but TurboGears supports class-style > form declaration.
As SQLObject is the de-facto standard DB interface for TurboGears, and it's syntax uses classes, having the forms for the data have similar structure in code makes sense. More than that, it's elegant to have differing but related components sharing implementation. > class MyForm(TableForm): > name = TextField() > age = TextField(validators=Int()) > > form = MyForm() There is much potential here. As an example, having default values be class method callables, as the default values in SQLObject can be simple callables. This could be forwarded into select widgets, allowing a callable to return a list of tuples. (A simple exmaple would be a lambda SQLObject.select() lookup. Having this structure would not only solve the issue of cloning for thread safety, but would also make my life a heck of lot simpler. ;^) - Matthew

