2 messages in com.googlegroups.pylons-discussRe: Typo in decorators docs examples?
FromSent OnAttachments
Graham Higgins27 Aug 2006 13:58 
Ben Bangert28 Aug 2006 10:51 
Subject:Re: Typo in decorators docs examples?
From:Ben Bangert (be@groovie.org)
Date:08/28/2006 10:51:40 AM
List:com.googlegroups.pylons-discuss

On Aug 27, 2006, at 1:58 PM, Graham Higgins wrote:

I'd appreciate some clarification with reference to the keyword value type to be supplied to pylons.rest.dispatch_on - is it a string or a function?

Pylons doc http://pylonshq.com/docs/0.9.1/module- pylons.decorators.rest.html states:

dispatch_on() ... "Multiple keyword arguments [...] The value should *not* be a string, but the actual function object that should be called."

Yet line 3 of the doc example shows the value as a string:

@pylons.rest.dispatch_on(POST='create_comment')

and line 42 of the corresponding source doc (http://pylonshq.com/docs/ 0.9.1/pylons/decorators/rest.py.html) similarly shows a string being supplied as the keyword value.

The example is right, it uses a string to get the function. This is so that you can have the order however you like, if we used the actual function it could make layout awkward since it'd need to be declared first. I'm updating the docs right now to be consistent on that.

Thanks for the catch.

Cheers, Ben