[Zope3-dev] Changes to the schema package
Philipp von Weitershausen
philipp at weitershausen.de
Tue Jan 6 10:41:39 EST 2004
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.
>> 2. Enumerated is a base class of many fields. XXX comments say that it
>> should go away, which makes a lot of sense, because enumerated fields
>> of that type can and should always be made separately. I propose to
>> remove Enumerated in all those places.
>
> I'm confused. Which XXX are you refering to?
Lots of, e.g. from src/zope/schema/interfaces.py
class IBytes(IMinMaxLen, IEnumerated, IIterable, IField):
# XXX IEnumerated will be removed in the future.
u"""Field containing a byte data(binary!).
The value might be contrained to be with length limits.
"""
class IASCII(IMinMaxLen, IEnumerated, IIterable, IField):
# XXX IEnumerated will be removed in the future.
u"""Field containing a byte string (like the python str).
The value might be contrained to be with length limits.
"""
...
class IText(IMinMaxLen, IEnumerated, IIterable, IField):
# XXX IEnumerated doesn't make sense for multi-line strings, so will
# be removed in the future.
Philipp
More information about the Zope3-dev
mailing list