sys._getframe.f_back.f_code.co_name.lower

Here are the examples of the python api sys._getframe.f_back.f_code.co_name.lower taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

View license
    def context(self):
        """Convert input to Context

        By default, convert json body to Convext for put/post request, convert args for get/delete request

        :rtype: Context
        :return Context object from request body or query
        """
        caller = sys._getframe().f_back.f_code.co_name.lower()
        if caller in ["post", "put"] and not request.path == "/api/user/file":
            return Context.from_object(request.get_json(force=True))
        else:
            return Context.from_object(request.args)

Example 2

View license
    def context(self):
        """Convert input to Context

        By default, convert json body to Convext for put/post request, convert args for get/delete request

        :rtype: Context
        :return Context object from request body or query
        """
        caller = sys._getframe().f_back.f_code.co_name.lower()
        if caller in ["post", "put"] and not request.path == "/api/user/file":
            return Context.from_object(request.get_json(force=True))
        else:
            return Context.from_object(request.args)