zopefoundation / z3c.form

An advanced form and widget framework for Zope 3
Other
8 stars 39 forks source link

Problem with default value when terms comes from a source #59

Open tdesvenain opened 7 years ago

tdesvenain commented 7 years ago

Default value is excluded because terms is empty when value is validated

tdesvenain commented 7 years ago

An example that reproduces the issue:

@provider(IContextAwareDefaultFactory)
def test_default(context):
    return context.UID()

class IBroadcastForm(form.Schema):
    test = schema.Choice(
        title=u"test",
        defaultFactory=test_default,
        source=UUIDSourceBinder(),
    )
    form.widget(test=RadioFieldWidget)