Review - REST support in Grok

View: New views
4 Messages — Rating Filter:   Alert me  

Parent Message unknown Review - REST support in Grok

by PAW :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there,

I've made some small modifications to the broken document concerning
Grok REST support:

http://grok.zope.org/documentation/how-to/rest-support-in-grok
https://blueprints.launchpad.net/grok/+spec/doc-rest-support-in-grok

Summary of changes:

 * Fixed the example to use 'grok.restskin()' rather than RESTProtocol
 * Modified the wording to refer more to rest skins rather than rest protocols
 * Added an example of applying a skin upon traversal to avoid "++rest++<restskin>" in the URL.

I would very much appreciate somebody reviewing the revised version.

Regards,
Paul


_______________________________________________
Grok-dev mailing list
Grok-dev@...
https://mail.zope.org/mailman/listinfo/grok-dev

Re: Review - REST support in Grok

by Jan-Wijbrand Kolman-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paul Wilson wrote:

> Hi there,
>
> I've made some small modifications to the broken document concerning
> Grok REST support:
>
> http://grok.zope.org/documentation/how-to/rest-support-in-grok
> https://blueprints.launchpad.net/grok/+spec/doc-rest-support-in-grok
>
> Summary of changes:
>
>  * Fixed the example to use 'grok.restskin()' rather than RESTProtocol
>  * Modified the wording to refer more to rest skins rather than rest
> protocols
>  * Added an example of applying a skin upon traversal to avoid
> "++rest++<restskin>" in the URL.
>
> I would very much appreciate somebody reviewing the revised version.

First couple of thoughts:

1) Can we somehow remove or update the comments that were left by
others? Some of the comments refer to outdate-ness that now has been
fixed. Maybe ew can leave a "reply" on those comments?

2) Near the end there's an example on how to apply the rest skin in a
traverse event subscriber. Useful! I would like to see a note though
that having this traverse event subscriber in there will effectively
bypass the "normal" view behaviour from that traverse step onwards.

Thanks!!

regards,
jw

_______________________________________________
Grok-dev mailing list
Grok-dev@...
https://mail.zope.org/mailman/listinfo/grok-dev

Re: Review - REST support in Grok

by PAW :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/10/14 Jan-Wijbrand Kolman <janwijbrand@...>

>
> Paul Wilson wrote:
> > Hi there,
> >
> > I've made some small modifications to the broken document concerning
> > Grok REST support:
> >
> > http://grok.zope.org/documentation/how-to/rest-support-in-grok
> > https://blueprints.launchpad.net/grok/+spec/doc-rest-support-in-grok
> >
> > Summary of changes:
> >
> >  * Fixed the example to use 'grok.restskin()' rather than RESTProtocol
> >  * Modified the wording to refer more to rest skins rather than rest
> > protocols
> >  * Added an example of applying a skin upon traversal to avoid
> > "++rest++<restskin>" in the URL.
> >
> > I would very much appreciate somebody reviewing the revised version.
>
> First couple of thoughts:
>
> 1) Can we somehow remove or update the comments that were left by
> others? Some of the comments refer to outdate-ness that now has been
> fixed. Maybe ew can leave a "reply" on those comments?

Yes - I wasn't going to touch the comments until someone had checked
my updates, but I'll sort it now.

> 2) Near the end there's an example on how to apply the rest skin in a
> traverse event subscriber. Useful! I would like to see a note though
> that having this traverse event subscriber in there will effectively
> bypass the "normal" view behaviour from that traverse step onwards.

Good spot - this is an important point. I'll make a note of it.

Thanks for taking the time to look at it for me; it really helps me
move forward with these documents that I'm reviewing.

Regards,
Paul
_______________________________________________
Grok-dev mailing list
Grok-dev@...
https://mail.zope.org/mailman/listinfo/grok-dev

Re: Review - REST support in Grok

by PAW :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/10/14 Jan-Wijbrand Kolman <janwijbrand@...>:
> First couple of thoughts:
>
> 2) Near the end there's an example on how to apply the rest skin in a
> traverse event subscriber. Useful! I would like to see a note though
> that having this traverse event subscriber in there will effectively
> bypass the "normal" view behaviour from that traverse step onwards.

How does this sound:

--%<--
Note that we apply the skin during traversal of the root (application)
object such that the skin is applied early. It is important to realise
that all requests made to views upon MyApp **and its subobjects**
will have the skin applied to it, since the traverser will always traverse
``MyApp`` en route. If this is a problem, you could subscribe to
traversal events from more specific objects such as containers and
models. However, you cannot subscribe to traversal events on your views.
This is because the traverser sees views as the end of traversal, not
part of it, and thus the ``grok.IBeforeTraverseEvent`` event will not
be issued.
--%<--

Thanks,
Paul
_______________________________________________
Grok-dev mailing list
Grok-dev@...
https://mail.zope.org/mailman/listinfo/grok-dev