#36254: Documentation 'Selecting the current time zone' code error
--------------------------------+-----------------------------------------
Reporter: YQ | Type: Bug
Status: new | Component: Documentation
Version: 5.2 | Severity: Normal
Keywords: timezone items | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+-----------------------------------------
ValueError at /set_timezone/
Need 2 values to unpack in for loop; got 6.
Request Method: GET
Request URL:
http://127.0.0.1:8000/set_timezone/
Django Version: 5.2b1
Exception Type: ValueError
Exception Value:
Need 2 values to unpack in for loop; got 6.
{{{
common_timezones = {
"London": "Europe/London",
"Paris": "Europe/Paris",
"New York": "America/New_York",
}
...
return render(request, "template.html", {"timezones": common_timezones})
...
# template.html
{% for city, tz in timezones %} # Error : Need 2 values to unpack in for
loop; got 6.
...
}}}
it should be
{{{
{% for city, tz in timezones.items %}
}}}
--
Ticket URL: <
https://code.djangoproject.com/ticket/36254>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.