django request object form calls
public python v1 · immutable# This function gets request object from callstack and is ligher than using inspect def get_calling_func(self): # request = None f = sys._getframe() while f: # look for request object if f.f_locals.has_key('request'): request = f.f_locals['request'] break f = f.f_back if rframe: return request else: return request