On 1/20/06, Patrick Lewis <[EMAIL PROTECTED]> wrote: > > Another vote for the status quo based on David's second point: I like > the fields declaration because it's simple to do dynamic forms created > at runtime. Just create your list of widgets based on some whatever > criteria applies, and then create your form. Yes, there's probably a > way to do it with the class methodology as well, but not without > mucking with the internals of the base class, and I'm not that clever, > so I'll probably get it wrong a few times.
I have no intention of getting rid of the existing instantiation mechanism. fastdata does exactly what you're describing here. The class-style declaration is just a prettier style. Unless I'm missing something, moving the widgets to a separate inner class may allow us to make the code really trivial. When the class is initialized, just go through that inner class, grabbing each widget and setting its name and moving it into the widgets list in the form. (Order will be preserved via the current counter mechanism.) For some reason, the existing code seems to be doing a lot more than that. > If you do decide to change to class style declaration, please provide a > way to add widgets to the object after it is instantiated. SQLObject > has "addColumn" and "delColumn", perhaps "addWidget" and "delWidget". form.widgets should still be a mutable list. Kevin -- Kevin Dangoor Author of the Zesty News RSS newsreader email: [EMAIL PROTECTED] company: http://www.BlazingThings.com blog: http://www.BlueSkyOnMars.com

