[Grok-dev] constructing URL for a RESTLayer view
josh at hipro.co.in
Sat Mar 9 02:50:24 UTC 2013
Thanks for the reply.
On Fri, 2013-03-08 at 22:45 +0100, Christian Klinger wrote:
> you can have a look here. It should give you an idea how it *could*
> work. I am not 100% sure if it works with RestLayers too.
This code is a part of grokcore.view-2.8. Moreover, from the following
>>> from zope.publisher.browser import applySkin
>>> request = TestRequest()
>>> applySkin(request, URLTestingSkin)
>>> # Shifting names normally happens during URL traversal.
>>> request._traversed_names = ['++skin++urltesting']
>>> index_view = component.getMultiAdapter((manfred, request),
And seeing the code from grokcore/view/util.py we find that the url is
manually manipulated with '++skin++' and it will not work for RESTLayer.
So, taking clue from this I too manipulated the url path with '++rest++'
string manually (for the time being).
Is there any other better way of doing this?
HiPro IT Solutions Private Limited
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: This is a digitally signed message part
More information about the Grok-dev