On 19 Jan, 2006, at 6:46 pm, David Bernard wrote:
I prefer the "fields" declaration :

form = TableForm(widgets=[
     TextField("name"),
     TextField("age", validators=Int())
 ])


David touches on my thoughts exactly.

1) the inner class is like SQLObject but not same. For user, and newbees, it's a cause of Bugs... why No fields appear in my form, or why error when I acces to the data. It's too similar

Plus, just because SQLObject does it doesn't make it the right thing to do.

2) fields is simple to understand for user, simple to use for form-maker (human or program)

I'd like to propose an alternative, which I'll code if necessary:

class TableForm(Form):
TextField("name")
TextField("age", validators=Int())

Then you can use:

TableForm.widgets['name'] => the name TextField
TableForm.widgets[1] => the age TextField

This prevents name clashes. It preserves order. It feels good*.

Jeff

* Your feelings may differ.

--
Jeff Watkins

“In science it often happens that scientists say, ‘You know that’s a really good argument; my position is mistaken,’ and then they actually change their minds and you never hear that old view from them again. They really do it. It doesn’t happen as often as it should, because scientists are human and change is sometimes painful. But it happens every day. I cannot recall the last time something like that happened in politics or religion.” Carl Sagan, 1987

Reply via email to