[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:31:38 +0300


>>It'll certainly break my code :-)
>
> How?

My code does a bunch of fragile things on top of the widgets code.

My plan has been to make changes in Zope that provide the features I 
need (or at least give me flexibility to add the features I need to my 
own code). As these changes get made, I can make my own code less special.

So, I'd like it if you would break my code by properly implementing 
features in Zope 3's code :-)


> setData is called judiciously to avoid overwriting values from the form.
> But, as Fred mentioned, setData should probably not override form values
> anyway.

I need the flexibility of overriding form values sometimes. Here's an 
example. I have a list of languages in a "what language do you speak" 
drop-down widget. I also have a text box to add a new language to that list.
What I want is if someone enters some text into the text-box and submits 
the form, that the language will be added to the list, *and* the new 
language will be selected.
I'd rather do this from my view class than by writing a special widget 
to do it.
I think it is reasonable for my view class to override the request in 
terms of what data to tell a widget it should present.


> The fact that getData does not raise an error when a value is 'missing',
> hopefully, won't cause too many problems. The validation for required
> fields occurs in applyChanges.

I'm really glad you've taken on all this tricky stuff.

--
Steve Alexander