phep
未读,2017年4月20日 07:51:512017/4/20登录即可回复作者
登录即可转发
您无权在此群组中删除帖子
请登录以举报消息
要么此群组的电子邮件地址为匿名状态,要么您得查看成员电子邮件地址权限才能查看原始帖子
收件人 django...@googlegroups.com
Hi all,
I just got this (slightly reformated for readability) exception I really
can't explain:
8<------------
NoReverseMatch at /saule/taiga/import/1/display
Reverse for 'display_taiga_report' with arguments '()' and keyword arguments
'{'report_id': '1', 'option': 'error_view'}'
not found.
2 pattern(s) tried:
['saule/taiga/import/(?P<report_id>[0-9]+)/display/(?P<option>[a-z]+)$',
'saule/taiga/import/(?P<report_id>[0-9]+)/display$']
8<------------
Why would the first pattern does not match since it has the 2 arguments?
This is my (part of) my urls.py:
8<------------
from django.conf.urls import url
from saule import views
app_name = 'saule'
urlpatterns = [
# index
url(r'^$', views.index, name='index'),
# Display reports
# ... [ stuff removed ] ...
url(
r'^taiga/import/(?P<report_id>[0-9]+)/display$',
views.display_taiga_report,
name='display_taiga_report'
),
url(
r'^taiga/import/(?P<report_id>[0-9]+)/display/(?P<option>[a-z]+)$',
views.display_taiga_report,
name='display_taiga_report'
),
# ... [ more stuff removed ] ...
]
8<------------
Then the bailing template line (there, the report_id variable is correctly
set to 1, as can be seen in the exception message):
8<------------
<a href="{% url 'saule:display_taiga_report' report_id=report_id
option='error_view' %}">
8<------------
Thanks in advance,
phep