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。