[Grok-dev] constructing URL for a RESTLayer view
Christian Klinger
cklinger at novareto.de
Fri Mar 8 21:45:43 UTC 2013
Hi Joshua,
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.
https://github.com/zopefoundation/grokcore.view/blob/master/src/grokcore/view/ftests/url/url.py#L174
HTH Christian
Joshua Immanuel schrieb:
> Hello,
>
> Is there a way to construct an URL for a RESTLayer's view dynamically,
> without me injecting the '++rest++<skin_name>' string into the URL
> manually.
>
> My use-case is as follows,
>
> class MyNormalView(grok.View):
> grok.context(IMyContext)
> grok.name('my_view')
> grok.template('some_template')
>
> def update(self):
> # I wan't to construct an URL for MyRESTView's GET
> # here using the self.context so that it can be used
> # in the template
> pass
>
> class MyRESTLayer(grok.IRESTLayer):
> grok.restskin('myskin')
>
> class MyRESTView(grok.REST):
> grok.context(IMyContext)
> grok.layer(MyRESTLayer)
>
> def GET(self):
> return "REST: GET request"
>
> Can someone enlighten me on this.
>
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
More information about the Grok-dev
mailing list