Opened 6 years ago

Closed 6 years ago

#29604 closed Bug (invalid)

Problem in views.py file: args used for positional argument

Reported by: Rajdeep Bharati Owned by: nobody
Component: Documentation Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

https://docs.djangoproject.com/en/2.0/intro/tutorial04/

The problem is in views.py file in the tutorial documentation:

return HttpResponseRedirect(reverse('polls:results', args=(question.id,)))

Now args is used for positional arguments, and there can be (in theory) multiple. So it should be a collection of items. For example:

return HttpResponseRedirect(reverse('polls:results', args=[question_id], ))

Change History (1)

comment:1 by Tim Graham, 6 years ago

Resolution: invalid
Status: newclosed

It's correct. (question.id,) is a tuple.

Note: See TracTickets for help on using tickets.
Back to Top