GoogleCloudPlatform/endpoints-proto-datastore — pull request #64 by sstriker (2013-04-25 23:02:08+00:00)
Title: Patch for issue 63: allow use of a wrapped endpoints.method

Allow use of a wrapped endpoints.method in EndpointsModel.method and EndpointsModel.query_method.

I'm setting the default namespace using namespace_manager based on the logged in user. To prevent forgetting setting of the namespace I put it in a wrapper, so that it gets done on each request.
This is similar to leveraging appengine_config.py:namespace_manager_default_namespace_for_request. The reason for not using that is because endpoints.get_current_user() doesn't work outside of an endpoints.method decorated function.

This patch adds _method_decorator as an argument to EndpointsModel.method and EndpointsModel.query_method. The default is to use endpoints.method as before.