jdost / restler

Python library to help integrate with RESTful web APIs
Other
0 stars 1 forks source link

Add `returns` option to route and subroutes #12

Open jdost opened 8 years ago

jdost commented 8 years ago

Add an attribute to a route that defines a class that will receive the processed data on a request and be returned from the call. Example:

flickr.albums._returns = PhotoAlbum
flickr.albums.vacation() # returns a PhotoAlbum(flickr.albums.vacation() Response)

This allows for a wrapper to define rich objects around the response bodies. Should be inherited by sub routes.