def METHOD_NAME(self, name, default):
    if hasattr(self, 'REQUEST'):
        REQUEST = self.REQUEST
        if name in REQUEST:
            return REQUEST[name]
        if hasattr(self, name):
            v = getattr(self, name)
        else:
            v = default
        REQUEST[name] = v
        return v
    else:
        if hasattr(self, name):
            v = getattr(self, name)
        else:
            v = default
        return v