DjangoGrappelli:找不到参数为“()”和关键字参数为“{}”的“grp_related”的Reverse

2024-04-20 03:27:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用django-grappelli在管理站点上创建可订购的内联线。偶尔(不可重复-大约50%的时间,这特别奇怪),当我尝试从内联保存订单时,Django会抛出以下异常:

 Exception Type: NoReverseMatch
 Exception Value: Reverse for 'grp_related_lookup' with arguments '()' and keyword arguments '{}' not found.
 Exception Location: /usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py in render, line 424

冒犯的底线是:

^{pr2}$

根据this related thread中给出的建议,我已经尝试在shell中快速测试它,但它似乎工作得很好:

>>> from django.core.urlresolvers import reverse
>>> print reverse('grp_related_lookup')
/grappelli/lookup/related/

我不知所措。有没有人有过类似的经历?在

Django版本是1.5.1。在


Tags: django订单站点type时间exceptionlookuparguments