2015-08-20 35 views
0

我不知道如何通過模板URL反向查找多個參數傳遞如何將多個參數傳遞給指定的組URL

<a href="{% url 'planner_by_location' {'pk':location.pk,'year':date_single[:3],'month':date_single[-6:5], 'day':date_single[-11:9]} %}">test</a> 

這個URL模式匹配:

r'^something/date/(?P<pk>\d+)/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$' 

得到錯誤:

Could not parse the remainder: '{"pk":location.pk,' from '{"pk":location.pk,' 

有人有線索嗎?

回答