📜  * 之后的 _reverse_with_prefix() 参数必须是可迭代的,而不是 int - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:35.005000             🧑  作者: Mango

代码示例1
#For this example:
scores_url = reverse('get_scores', args=(obj.pk))

#putting a comma at the end of the args tuple fixes it.
scores_url = reverse('get_scores', args=(obj.pk,))

#Alternatively, as mentioned in the docs, using a list would work fine:
scores_url = reverse('get_scores', args=[obj.pk])