2010-06-05 32 views

回答

1

我,你试图做一个“目录”的事情的假设下写这一个JavaScript对象。如果情况并非如此,并且以下信息无用,我表示歉意。

如果你知道你想要的前手的动作(也就是,在运行时间之前)控制器,你可以写

def contents(self): 
    return [action for action in dir(self) if all(
     not action in ['contents','start_response'], 
     not action.startswith('_'), 
     callable(action))]

每个控制器,然后还有一个控制器(ContentsController,说)为每个方法调用.contents()方法。

相关问题