30๐
โ
As mentioned in this comment, putting a comma at the end of the args tuple fixes it.
scores_url = reverse('get_scores', args=(obj.pk,))
(As mentioned in this SO answer, trailing comma is required for single-item tuples to disambiguate defining a tuple from an expression surrounded by parentheses)
Alternatively, as mentioned in the docs, using a list would work fine:
scores_url = reverse('get_scores', args=[obj.pk])
๐คAnupam
0๐
You can also try to use kwargs={'pk':models_saving_variable.pk}
.
The final code will be:
return HttpResponseRedirect(reverse('app_name:view_name', kwargs={'pk': saving_variable.pk}))
๐คThe.lYNCAN
- Decorators run before function it is decorating is called?
- Will Django be a good choice for a permissions based web-app?
- Crispy-forms: add css class for one of the inputs
- How does default_token_generator store tokens?
Source:stackexchange.com