

@classmethod
def get_request(cls):
    '\n        Get the HTTPRequest object from thread storage or from a callee by searching\n        each frame in the call stack.\n        '
    request = cls.get_global('request')
    if request:
        return request
    try:
        stack = inspect.stack()
    except IndexError:
        return
    for (frame, _, _, _, _, _) in stack:
        if ('request' in frame.f_locals):
            if isinstance(frame.f_locals['request'], HttpRequest):
                request = frame.f_locals['request']
                cls.set_global('request', request)
                return request

dataset/ETHPy150Open disqus/nexus/nexus/modules.py NexusModule.get_request/original