john saponara a écrit :
hi,

please point me to an example showing how to use ObjectWidget with a default add form. in case there is no example, perhaps my failing attempt below could serve as one, once it's modified to work.

[...]

ComponentLookupError: ((<zope.schema._field.Object object at 0x03584090>, <zope.publisher.browser.BrowserRequest instance URL=http://localhost:2020/mylimo/@@+/action.html>), <InterfaceClass zope.app.form.interfaces.IInputWidget>, u'') 127.0.0.1 - -

It seems you have no widget associated to your Object field.
You should use less zcml and implement your own addform:

  driver_widget = CustomWidgetFactory(ObjectWidget, Driver)

  class DriverAddForm(AddForm):
    form_fields = Fields(IDriver)
    form_fields['car'].custom_widget = driver_widget
    def __init__(self, context, request):
        (...)
    def create(self.data):
        (...)

Christophe
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to