2014-06-21 17 views
1

我試圖在Eve中使用pre_get事件掛鉤,但試圖在Web上運行示例頁面出現以下錯誤信息:「類型錯誤:pre_get_callback()缺少1需要的位置參數:'lookup'」當在夏娃使用get事件鉤

TypeError: pre_get_callback() missing 1 required positional argument: 'lookup'.

完整shortdump可在gist.github

這是我的代碼

def pre_get_callback(resource, request, lookup): 
    print ('A GET request on the "%s" endpoint has just been received!' % resource) 
    lookup["username"] = {'$exists': True} 

我使用Python 3.3和最新版本的Eve。

回答

2

lookup是一個0.4特徵(changelog)。你可能使用v0.3或更低版本。如果是這種情況,一個簡單的

pip install eve --upgrade 

將解決您的問題。昨天順便發佈了Eve 0.4。

相關問題