[Zope3-dev] Proposal: Vocabulary Fields
Steve Alexander
steve@cat-box.net
Tue, 29 Apr 2003 13:13:33 +0200
Martijn wrote:
>>> I still disagree with this multiplication of entities; we now have
>>> fields and enumerated fields while before we just had one kind.
>>> I still haven't seen a motivation for this.
Guido wrote:
>> Isn't there a way to make the "enumerated" part an option, like
>> min_size and required, rather than a new type?
Steve wrote:
> Yes.
>
> I explained this in my earlier email to this list and to Fred.
>
> I'll try to dig out the reference from the archives.
http://mail.zope.org/pipermail/zope3-checkins/2003-April/008335.html
So, it wasn't this list.
Here's the relevant part:
----
(SteveA)
I was going to make a similar change to this field type.
However, rather than make a different implementation class, I was going
to use the same implementation class, and have instances change their
own interface declaration depending on whether allowed_values is defined.
This allows you to use a different widget for an any-values fields to
the one used for an allowed-values field.
Other than this change of constraint, I see no problem with the same
implementation being used. I see no more problem with changing an
allowed_values constraint on a Field instance than with changing any
other constraint on a Field instance.
(Quote from Fred)
> As I'm sure you understand, the biggest aspect of schema change is
> proper support for the new schema in the application, and when
> expanding the set of allowed values for a field, the hardest part is
> ensuring the code has been tested thoroughly and that edge cases are
> properly located and checked. There's far more than making a couple
> of edits to spelling of the schema.
(SteveA)
Do you propose disallowing any other changes to the notional set of
valid values for a field?
Do you want Field instances to be immutable?
----
--
Steve Alexander