Typo in decorators docs examples?

0 views
Skip to first unread message

Graham Higgins

unread,
Aug 27, 2006, 4:58:54 PM8/27/06
to pylons-...@googlegroups.com
Hi,

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.

Cheers,

Graham Higgins.

Ben Bangert

unread,
Aug 28, 2006, 1:52:03 PM8/28/06
to pylons-...@googlegroups.com

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

Reply all
Reply to author
Forward
0 new messages