我有一個金字塔的Web服務和代碼示例如下:金字塔路線匹配和查詢參數
查看聲明:
@view_config(route_name="services/Prices/GetByTicker/")
def GET(request):
ticker = request.GET('ticker')
startDate = request.GET('startDate')
endDate = request.GET('endDate')
period = request.GET('period')
路由:
config.add_route('services/Prices/GetByTicker/', 'services/Prices/GetByTicker/{ticker}/{startDate}/{endDate}/{period}')
現在我知道這都搞砸了,但我不知道金字塔的慣例是什麼。目前這個工作原理是因爲請求被成功路由到視圖,但是我得到一個「Dictionary object not callable」異常。
的URL看起來可怕:
@根/服務/價格/ GetByTicker /股票= APPL /的startDate = 19981212 /結束日期= 20121231 /週期= d
理想情況下,我想能夠使用一個URL是這樣的:?
@根/服務/價格/ GetByTicker /股票= APPL &的startDate = 19981212 &結束日期= 20121231 &週期= d
任何金字塔BODS出日是否願意花五分鐘解釋我做錯了什麼?
謝謝。正是我在找的東西。它始終是你從文檔中找不到的簡單答案... –