[Zope3-dev] Re: [Zope3-checkins] CVS: Zope3/src/zope/schema -_bootstrapfields.py:1.19.2.1

Garrett Smith garrett@mojave-corp.com
Tue, 29 Jul 2003 09:04:54 -0500


Shane Hathaway wrote:
> Steve Alexander wrote:
>> Here's a different ASCII chart that includes my fancy "N/A" feature
>> where a user can enter something that looks like "N/A" into a text
>> widget to indictate that it is missing.
>>=20
>>=20
>>                 Non-empty input      Empty or no input   Matches
>>                                                          "N/A"-like
>> regex=20
>>=20
>>  Required       Set the field value  Validation fails    Validation
>> fails=20
>>=20
>>  Not required   Set the field value  Set field value to  Set field to
>>                                      an empty string   =20
>> missing_value=20
>>=20
>>=20
>> I don't think this is an important feature for text widgets in
>> general. I include it here to illustrate where the missing_value
>> comes in.=20
>=20
> If the forms framework supports this functionality, and the knowledge
> of the chart is fully encapsulated in the widget, I'll be quite happy
> with the framework.

I think it's safe to say that widgets can freely map their states/input
to 'missing value' as they see fit. I would not expect to see this
support in the default TextWidget.

Let's see if I can summarize the emerging consensus:

1. Given missing or zero-length-string input, TextWidget will update its
field with a zero-length-string.

2. TextWidget should raise some sort of validation error when a
zero-length-string is submitted for a required field. Note that,
strictly speaking, this behavior may not be consistent with the field
settings -- the field may be required and define None as missing_value,
in which case an empty string would be a valid assignment. However, this
behavior would not be consistent with developer expectations for
web-based forms.

Anything to add, remove, amend?

 -- Garrett