def wrap(*args, **kwargs): user = GenericUser.create_from(args[0].user) funcargs = inspect.getargspec(func).args if not funcargs is None and 'user' in funcargs: kwargs['user'] = user result = func(*args, **kwargs) result['user'] = json.dumps(user.to_dict()) result['py_user'] = user return result
def process(self, request, kwargs, context): user = GenericUser.create_from(request.user) context['user'] = json.dumps(user.to_dict())
def wrap(*args, **kwargs): user = GenericUser.create_from(args[0].user) kwargs['user'] = user result = func(*args, **kwargs) return result