Don't mix *args and **kwargs in call to reverse()!
尝试将 args 和 kwargs 传递给视图时出现错误。在这一点上,我已经尝试了很多事情,但无法理解这一点——完全停留在如何将两者都传递给视图。
我需要将两者都传递unipart
给newfile
另一个视图。
url(r'^(\d+)/(\d+)/convert/$', 'store.views.changetool', name = "convert"),
url(r'^(\d+)/view_part/$','store.views.view_part',name="view_part"),
VIEWS.PY(更改工具)
def changetool (request, id, unipart=None):
part = Part.objects.get(id=id)
file = str (part.content)
newfile = FormatConversion.ConvertToNew(file)
return redirect('view_part', unipart, newfile = newfile)
VIEWS.PY (view_part)
def view_part(request, part_id, newfile = None):