Example #1
0
 def get(cls, key, client=None):
     """Lookup the request key in memcache and then the datastore."""
     request = cache.get_from_cache(cls, key)
     if client and client != request.client:
         raise exceptions.UnauthorizedException('Client "%s" is not ' \
             'authorized to access Request "%s".' % (client, request))
     return request
Example #2
0
 def get(cls, key, client=None, parent=None):
     """Lookup the model in memcache and then the datastore."""
     model = cache.get_from_cache(cls, key, parent)
     if client and client != model.client:
         raise exceptions.UnauthorizedException(
             'Client "%s" is not authorized to access %s "%s".' % (
                 client, model.kind(), model))
     return model