wJIc @ ss d Z d d k Z d d k l Z d d k l Z d d k l Z d d g Z e i e Z d Z d Z d S( s REST decoratorsiN( t decorator( t abort( t get_pylonst dispatch_ont restrictc s f d } t | S( s Restricts access to the function depending on HTTP method Example: .. code-block:: python from pylons.decorators import rest class SomeController(BaseController): @rest.restrict('GET') def comment(self, id): c sY t | i i j o3 t i d t d d d d i f g n | | | S( s Wrapper for restricts Method not allowed by restricti t headerst Allowt ,( R t requestt methodt logt debugR t join( t funct argst kwargs( t methods( s: /usr/lib/python2.6/site-packages/pylons/decorators/rest.pyt check_methods s &( R ( R R ( ( R s: /usr/lib/python2.6/site-packages/pylons/decorators/rest.pyR s c s f d } t | S( s Dispatches to alternate controller methods based on HTTP method Multiple keyword arguments should be passed, with the keyword corresponding to the HTTP method to dispatch on (DELETE, POST, GET, etc.) and the value being the function to call. The value should be a string indicating the name of the function to dispatch to. Example: .. code-block:: python from pylons.decorators import rest class SomeController(BaseController): @rest.dispatch_on(POST='create_comment') def comment(self): # Do something with the comment def create_comment(self, id): # Do something if its a post to comment c sb i t | i i } | o0 t | | } t i d | | i | | S| | | | S( s Wrapper for dispatch_ons Dispatching to %s instead( t getR R R t getattrR R t _inspect_call( R t selfR R t alt_method( t method_map( s: /usr/lib/python2.6/site-packages/pylons/decorators/rest.pyt dispatcher<