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

Steve Alexander steve@z3u.com
Tue, 22 Jul 2003 19:56:57 +0300


>>I agree. What is the motivation for making '' the default missing
>>value? 
> 
> 
> This is Steve's position, so I won't speak for him. I think in practice,
> though, users of HTML forms will expect a blank string to be considered
> 'missing'. I realize that a) we haven't defined 'missing' (doing that as
> we speak) and b) fields aren't used exclusively in HTML forms.
> 
> I see the merits of both sides here and, ultimately, this is a design
> decision for the schema author. This is why I exposed missing_value in
> the Field ctor.

So long as it is possible to use '' as a missing value for a text field, 
I'm not too bothered what the default is.

I don't think None is a useful value for the missing value of a text 
field. I can't think of many cases where the empty string and indicates 
explicitly input data.

> It would be nice to see a delineation in the API between values that are
> meant for objects and internal data used by the widget. Currently, I
> have these as getData and getUnconvertedData respectively.
> 
> getUnconvertedData -> getUserInput?
> 
> Btw, the notion of convert and unconvert is a bit ambiguous. I think
> something like:
> 
>   fieldValueToUserInput(fieldValue)
> 
>   userInputToFieldValue(userValue)
> 
> I realize that 'user' input doesn't always come from users, but I think
> it's useful to think of this data in terms of what is submitted to the
> field or HTML form.

How about importToField and exportFromField ?

--
Steve Alexander