[Zope3-dev] Re: [Zope3-checkins] CVS: Zope3/src/zope/schema -
_bootstrapfields.py:1.19.2.1
Steve Alexander
steve@z3u.com
Tue, 22 Jul 2003 18:15:57 +0300
> > - Text fields have a missing_value of '' (empty string) instead of None.
>
> Argh. I know there is a popular position that this is the right thing
> to do, but it doesn't feel right to me. Using None as the default
> missing_value makes it easier to detect careless bugs.
I think this is a resonable default for Text Fields, along with a
min_length of 1. It is easy to specify a missing_value of None for a
particular text field instance, or subclass.
> > - Removed the 'strict' argument from applyWidgetChanges since no one was
> > using it and there's no clear application for it.
>
> Yeehaa! Isn't YAGNI wonderful? ;-)
How do you know it is not being used in other projects that are not
checked into public CVS?
I'll need to check my own code.
> setData()
> Set the initial value of the widget for it's initial display.
> When a form is re-rendered due to a "partial submit", this value
> is ignored, and the value from the request is used instead. This
> requires *really* knowing what the value was on the browser when
> the submit button was pressed---even if it was an empty string.
Related to this, I want to be able to set up a widget with
erroneous/missing data, so that on first viewing a page, I can have it
rendered as if that same data had been present in the request.
> Changing the
> get/have/setData() behavior needs very careful review. The effects
> to code will spread well beyond the Zope 3 core, and not just in Zope
> Corporation projects.
It'll certainly break my code :-)
--
Steve Alexander