> I'm uncomfortable with this. Right now, I think fields do too much.
> They have too much application logic. This would add more. The whole
> concept of "initial value" seems to be very application dependent.
> Maybe it would be best to just drop the default field altogether
> and introduce adapters for computing initial values in those special
> cases when we need them.
Funnily, I just faced this dilema earlier today. I nearly created an interface
"""An interface for obtaining an initial value for an object."""
"""Returns the initial value."""
IMO, this is superior to field.initial. E.g.
zapi.getMultiAdapter((field, context), IInitialValue).get()
Perhaps this pattern could be used for getting an ISource from a field. E.g.
zapi.getMultiAdapter((field, context), ISource)
Zope3-dev mailing list