def check_permissions(): pass # This method should rarely be ovewritten. @songs.get_format def get_format(): pass # (...) # The problem I see with this is how to build a resource from existing models # using this approach. Doesn't look very straightforward at first. # Maybe... api.resource(Audio, methods=['GET', 'POST', 'DELETE']) # -- # Traversal # ========= # As seen on: # http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/traversal.html # and # http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/resources.html class RootResource(object): """ """
@songs.authorize def check_permissions(): pass # This method should rarely be ovewritten. @songs.get_format def get_format(): pass # (...) # The problem I see with this is how to build a resource from existing models # using this approach. Doesn't look very straightforward at first. # Maybe... api.resource(Audio, methods=['GET', 'POST', 'DELETE']) # -- # Traversal # ========= # As seen on: # http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/traversal.html # and # http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/resources.html class RootResource(object):