2010-06-05 77 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()方法。

相關問題