Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(76)  |  Call(76)  |  Derive(0)  |  Import(0)
Adds a resource to the api.

:param resource: the class name of your resource
:type resource: :class:`Resource`
:param urls: one or more url routes to match for the resource, standard
             flask routing rules apply.  Any url variables will be
             passed to the resource method as args.
:type urls: str

:param endpoint: endpoint name (defaults to :meth:`Resource.__name__.lower`(more...)

src/b/o/bokeh_examples-HEAD/api.py   bokeh_examples(Download)
 
 
api.add_resource(Count, '/api/v1.0/count')
api.add_resource(RSSIData, '/api/v1.0/<string:update_lim>')
api.add_resource(RSSIDataSlice, '/api/v1.0/slice/<string:lowerupper>')

src/f/l/flask-restful-HEAD/examples/todo.py   flask-restful(Download)
## Actually setup the Api resource routing here
##
api.add_resource(TodoList, '/todos')
api.add_resource(Todo, '/todos/<string:todo_id>')
 

src/f/l/flask-restful-HEAD/examples/xml_representation.py   flask-restful(Download)
        return {'hello': entry}
 
api.add_resource(Hello, '/<string:entry>')
 
if __name__ == '__main__':

src/f/l/flask-restful-HEAD/examples/todo_simple.py   flask-restful(Download)
        return {todo_id: todos[todo_id]}
 
api.add_resource(TodoSimple, '/<string:todo_id>')
 
if __name__ == '__main__':

src/s/h/shiva-0.8.0/shiva/app.py   shiva(Download)
 
# Artists
api.add_resource(resources.ArtistResource, '/artists',
                 '/artists/<int:artist_id>', '/artists/<artist_slug>',
                 endpoint='artists')
api.add_resource(resources.ShowsResource, '/artists/<int:artist_id>/shows',
                 '/artists/<artist_slug>/shows', endpoint='shows')
 
# Albums
api.add_resource(resources.AlbumResource, '/albums', '/albums/<int:album_id>',
 
# Tracks
api.add_resource(resources.TrackResource, '/tracks', '/tracks/<int:track_id>',
                 '/tracks/<track_slug>', endpoint='tracks')
api.add_resource(resources.LyricsResource, '/tracks/<int:track_id>/lyrics',

src/s/h/shiva-server-HEAD/shiva/app.py   shiva-server(Download)
 
# Artists
api.add_resource(resources.ArtistResource, '/artists',
                 '/artists/<int:artist_id>', '/artists/<artist_slug>',
                 endpoint='artists')
api.add_resource(resources.ShowsResource, '/artists/<int:artist_id>/shows',
                 '/artists/<artist_slug>/shows', endpoint='shows')
 
# Albums
api.add_resource(resources.AlbumResource, '/albums', '/albums/<int:album_id>',
 
# Tracks
api.add_resource(resources.TrackResource, '/tracks', '/tracks/<int:track_id>',
                 '/tracks/<track_slug>', endpoint='tracks')
api.add_resource(resources.LyricsResource, '/tracks/<int:track_id>/lyrics',

src/r/e/REST-tutorial-HEAD/rest-server-v2.py   REST-tutorial(Download)
        return { 'result': True }
 
api.add_resource(TaskListAPI, '/todo/api/v1.0/tasks', endpoint = 'tasks')
api.add_resource(TaskAPI, '/todo/api/v1.0/tasks/<int:id>', endpoint = 'task')
 

src/p/o/pocket-change-0.0.5/pocket_change/rest/util.py   pocket-change(Download)
        def _endpoint(resource):
 
            if name:
                self.add_resource(resource, *self.route_map[resource], endpoint=name)
            else:
                self.add_resource(resource, *self.route_map[resource])

src/p/o/pocket_change-HEAD/pocket_change/rest/util.py   pocket_change(Download)
        def _endpoint(resource):
 
            if name:
                self.add_resource(resource, *self.route_map[resource], endpoint=name)
            else:
                self.add_resource(resource, *self.route_map[resource])

src/m/a/maproulette-HEAD/maproulette/api/__init__.py   maproulette(Download)
 
# Add all resources to the RESTful API
api.add_resource(ApiPing,
                 '/api/ping')
api.add_resource(ApiSelfInfo,
                 '/api/me')
# statistics endpoints
# basic stats for one challenge
api.add_resource(ApiStatsChallenge,
                 '/api/stats/challenge/<string:slug>')
# detailed user breakdown for one challenge
api.add_resource(ApiStatsChallengeUsers,
                 '/api/stats/challenge/<string:slug>/users')
# summary stats for all challenges
api.add_resource(ApiStatsChallenges,

  1 | 2  Next