[Zope3-dev] Schema, widget and form refactoring (was Re: [Zope3-checkins] CVS:Zope3/src/zope/schema - _bootstrapfields.py:1.19.2.1)

Garrett Smith garrett@mojave-corp.com
Tue, 22 Jul 2003 13:30:06 -0500


Fred L. Drake, Jr. wrote:

>  > In fact, I'd argue that all of this conversion stuff should be
>  handled > *outside* the widget -- and that the widget focusses only
>  on UI issues. > These have become exceedingly intelligent widgets --
> bad, IMO.=20
>=20
> I disagree.  What sorts of conversions need to be done depends on the
> sorts of user inputs are available; not all possible inputs will be a
> string, a list of strings, a dict filled with strings, or None.
> Whatever deals with the input source has to deal with converting that
> to something useful.
>=20
> That's what a widget does.

Okay :-)

I might be knee-jerking from UI frameworks that keep the view and
controllers separate.

I still disagree...but...

>  > But I'm certainly not signing up for changing this now :-)
>=20
> Thank you.  We seem to have enough going on at once.  ;-)

Yes...I've gotten very tired all of a sudden.

> If you want to remove something from widgets, make it the label() and
> row() methods.  And the things Jim's marked as deprecated (render(),
> hidden()).

See above ;-) But yes, these need to go.

Will be a snap once this other stuff is resolved.

>  > This distinction arises in the fact that *all* of the widgets are
>  > populated in preparation for the form submit processing, even those
>  > widgets that don't have data in the form.
>=20
> I'll think about this some more.  It's good that you're questioning
> the assumptions, but it's not clear to me that this particular aspect
> is getting anywhere.

It gets somewhere when you submit forms that don't contain all of the
fields. This doesn't happen with casual use, but when you write ftests,
it shows up glaringly.

> Where are these assumptions made?  The only place I've noticed is in
> the zope.app.browser.form package, which is really just a pile of
> widget implementations.  We've certainly created and very successfully
> used widgets that defy that assumption.  The general form-handling
> code in zope.app.form seems fine; it goes to the widget to find out
> what's what.

I'll take a look.

 -- Garrett