[Zope3-dev] Re: Changes to the schema package
Garrett Smith
garrett at mojave-corp.com
Wed Jan 7 11:41:03 EST 2004
Philipp von Weitershausen wrote:
> Jim,
>
>>> Some XXX comments also say, that a value_type/key_type of None should
>>> not be accepted, but I disagree. I can see that sometimes you do not
>>> want the value or key of a sequence or dictionary to be of a special
>>> type. That's when you pass None for value_type/key_type, so the value
>>> or key will not be validated with a field.
>>
>>
>> That's fine, however, if you don't specify a value type, you can't
>> get a widget for it. You won't be able to generate a form that
>> has such a field. Technically, the field type isn't necessary,
>> but, since most people expect to be able to get widgets, it's probably
>> an error if you don't have one.
>
>
> Maybe. It'd be great to have some input here to know how other people
> think.
I'm not using any of these types myself, so I can't offer any solid use
cases for or against.
Given the relationship between fields and widgets, though, I'm inclined
to agree with Jim -- can a view (i.e. widget) to such a field really
succeed without knowing anything about the values/keys?
If you want to store _anything_, can you get by with a field like
IObject? (I don't know if that already exists.)
Could you give an example of when you'd want value_type/value_key to be
None and how widgets/forms would handle such a case?
I don't really have a strong opinion on this.
-- Garrett
More information about the Zope3-dev
mailing list