Don Hopkins wrote:
Some folks have expressed that they'd like forms to be like this:
class MyForm(TableForm):
foo1 = TextField()
foo2 = TextField()
which is consistent with the SQLObject style, but is not consistent
with how other widgets (TextField, for example) work.
The problem with the class based approach is that there's no way to
reconstruct the order of the fields in the class, which is required for
generating forms (of more than one field ;-). Since the fields are
defined in the class's dictionary, which is unordered, there's no way to
determine the order they appear in the source code, so you have to use
an array of fields instead.
If you control the source of TextField(), you can make it increment a
counter everytime it is instantiated. Then you sort according to this
counter, essentially sorting them by their creation time.
This is how SQLObject started (if only recently) to keep track of the
order of its columns.
--
Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org