flask_restful_dbbase.resources.MetaResource.get_urls¶
- classmethod MetaResource.get_urls()[source]¶
This function returns a default url for the resource. To keep consistency with the get_urls functions in other resources, it returns the url in a list, even though there would never be more than one.
The approach enables a code consistent approach when using the api.add_resource function.
Example:
api.add_resource(BookResource, *BookResource.get_urls()) api.add_resource(BookCollection, *BookCollection.get_urls()) api.add_resource(BookMetaResource, *BookMetaResource.get_urls()) api.add_resource(BookMetaCollection, *BookMetaCollection.get_urls())
Default URLS: /books /books/<int:id> /meta/books/single /meta/books/collection
Bear in mind that the get_urls function is only for convenience when adding the resource the api.