[Zope3-Users] Sourcetext-mux

Frank Burkhardt fbo2 at gmx.net
Wed Nov 9 04:59:55 EST 2005


Hi,

I found a code fragment in an example-application which enables a
View-Object to render a SourceText using a renderer of the user's choice.

class ViewClass(object):
    def render(self):
        entry_text = zapi.createObject(None,
                                       self.context.renderer,
                                       self.context.text)
        view = zapi.getView(removeAllProxies(entry_text), '', self.request)
        result = view.render()

context.renderer contains a token of the 'SourceTypes'-Vocabulary (i.e.
'zope.source.rest'), context.text is the text to be rendered. The 'result' should be some
kind of html (xhtml preferred :-) ).

Zope Complains about this code, telling me, not to use zapi.getView() but zapi.getMultiAdapter()
but there's no hint, what parameters to use for getMultiAdapter.

Does anyone know the correct getMultiAdapter()-line - maybe with an explaination?

Thank you,

Frank


More information about the Zope3-users mailing list