#36254: Documentation 'Selecting the current time zone' code error
--------------------------------+--------------------------------------
     Reporter:  YQ              |                    Owner:  (none)
         Type:  Bug             |                   Status:  new
    Component:  Documentation   |                  Version:  5.2
     Severity:  Normal          |               Resolution:
     Keywords:  timezone items  |             Triage Stage:  Unreviewed
    Has patch:  1               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+--------------------------------------
Description changed by YQ:

Old description:

> 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 %}
> }}}

New description:

 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 %}
 }}}


 https://github.com/django/django/pull/19270

--
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36254#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070195941599c8-fe734897-6047-442a-b757-30f10f866e0b-000000%40eu-central-1.amazonses.com.

Reply via email to