As I'm digging through to fix the
CustomWidgetFactory collector issue, I found the following:

IWidget has no __init__ defined

class Widget(object):
    def __init__(self, context, request):

class ItemsWidgetBase(TranslationHook, SimpleInputWidget):
    def __init__(self, field, vocabulary, request):

class ItemsEditWidgetBase(SingleDataHelper, ItemsWidgetBase):
    def __init__(self, field, vocabulary, request):

class ObjectWidget(BrowserWidget, InputWidget):
    def __init__(self, context, request, factory, **kw):
class SequenceWidget(BrowserWidget, InputWidget):
    def __init__(self, context, field, request, subwidget=None):

class SequenceDisplayWidget(DisplayWidget):
    def __init__(self, context, field, request, subwidget=None):

class SourceDisplayWidget(
    def __init__(self, field, source, request):

class SourceInputWidget(
    def __init__(self, field, source, request):

class SourceSelectWidget(
    def __init__(self, field, source, request):

CustomWidgetFactory fails on these different signatures. This affects
the ZCML <browser:widget field="..." class="..."/>. Simple widgets
will work, widgets with different signatures of course not.

class CustomWidgetFactory(object):
    def __call__(self, context, request):
class CustomSequenceWidgetFactory(object):
    def __call__(self, context, field, request):

In fact, CustomSequenceWidgetFactory violates the IViewFactory
interface with the different __call__ signature. That causes
setUpWidget to fail. I'm wondering if this worked for anyone anytime.

Now I'm stuck a little bit. How does a good solution look like?

My half-baked solution was up to today for Itemswidgets (which caused
the error for me) to mark it with a different interface and look for
that in CustomWidgetFactory and pass different arguments.
Now I'm not so sure that this is the right one.

Best regards,
 Adam                          mailto:[EMAIL PROTECTED]
Quote of the day:
Every person should have a special cemetery lot in which to bury the faults of 
friends and loved ones. 
- Anonymous 

Zope3-dev mailing list

Reply via email to