def switch_on(view, request_layer=z3c.form.interfaces.IFormLayer): """Fix up the request and apply the given layer. This is mainly useful in Zope < 2.10 when using a wrapper layout view. """ request = view.request if (not IFixedUpRequest.providedBy(request) and not IBrowserApplicationRequest.providedBy(request)): interface.alsoProvides(request, IFixedUpRequest) interface.alsoProvides(request, request_layer)
def switch_on(view, request_layer=z3c.form.interfaces.IFormLayer): """Fix up the request and apply the given layer. This is mainly useful in Zope < 2.10 when using a wrapper layout view. """ request = view.request if (not IFixedUpRequest.providedBy(request) and not IBrowserApplicationRequest.providedBy(request) ): interface.alsoProvides(request, IFixedUpRequest) interface.alsoProvides(request, request_layer)
def switch_on(view, request_layer=z3c.form.interfaces.IFormLayer): """Fix up the request and apply the given layer. This is mainly useful in Zope < 2.10 when using a wrapper layout view. """ request = view.request if (not IFixedUpRequest.providedBy(request) and not IBrowserApplicationRequest.providedBy(request) ): interface.alsoProvides(request, IFixedUpRequest) interface.alsoProvides(request, request_layer) if getattr(request, 'locale', None) is None: request.locale = setup_locale(request) if not hasattr(request, 'getURL'): add_getURL(request)