Hi there.

I am trying to port z3c.widget.namespace so I can use what I had in
zope.formlib already and I am having a hard time here.
The namespace code is very simple and is almost identical with
z3c.widget.namespace. The only difference is that I've registered the
view to z3c.form.interface.IWidget and will need some other code to
fullfill what is needed.
The namespace is like the following.


class WidgetHandler(SimpleHandler):

    def __init__(self, context, request=None):
        self.context = context
        self.request = request

    def traverse(self, name, ignored):
        name = name.split('.')[-1]
        widget = removeSecurityProxy(self.context).field.widgets[name]
        return widget

When I try something like:


It won't traverse because my context is a z3c.pagelet and it is 100% empty.

(Pdb) self.context
<z3c.pagelet.zcml.MyAddForm object at 0x2ebfc50>
(Pdb) dir(self.context)

Does anyone know how to traverse to a z3c.form widget?

Best Regards,
Zope3-users mailing list

Reply via email to