Opened 12 hours ago
Last modified 5 hours ago
#36254 assigned Bug
Documentation 'Selecting the current time zone' code error
Description (last modified by ) ¶
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 %}
According to the ticket's flags, the next step(s) to move this issue forward are:
- For a Django committer to do a final review of the patch and merge it if all looks good.
Change History (4)
comment:1 by , 11 hours ago
Has patch: | set |
---|
comment:2 by , 11 hours ago
Description: | modified (diff) |
---|
comment:3 by , 10 hours ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 5.2 → dev |
comment:4 by , 5 hours ago
Owner: | set to |
---|---|
Status: | new → assigned |
Triage Stage: | Accepted → Ready for checkin |
Note:
See TracTickets
for help on using tickets.
Thank you!