title: How to loop through a list of dictionaries with in a dictionary and get the values within - Javascript, for an ajax call in django
body: <p>I have a list </p>
  
  <pre><code>mylist =  [{"model": "todolist.todolist", "pk": 1, "fields": {"timezoneChoice": "Africa/Johannesburg", "user": 44, "name": "ergdsg", "discription": "dsgdsg", "dueMinutes": -61504892, "emailSent": false, "dueDate": "1899-12-11T08:20:00Z", "create_at": "2016-11-21T04:37:29.253Z"}}, {"model": "todolist.todolist", "pk": 2, "fields": {"timezoneChoice": "Africa/Johannesburg", "user": 44, "name": "ergdsg", "discription": "dsgdsg", "dueMinutes": -61504892, "emailSent": false, "dueDate": "1899-12-11T08:20:00Z", "create_at": "2016-11-21T04:38:12.525Z"}}]
  </code></pre>
  
  <p>I am trying to get the value from the "fields" and their keys</p>
  
  <pre><code>for (var i = 0; i &lt; mylist.length; i++) {
  
                      $("#posts").prepend( "&lt;div &gt;" +"&lt;h2 class='bg-info text-align-center'&gt; Tasks" +"&lt;/h2&gt;"
                                           + "&lt;strong&gt; Name: " + " "  + mylist[i].name + "&lt;/strong&gt;"
                                           + "&lt;strong&gt; Task: " + " "  + mylist[i].discription + "&lt;/strong&gt;"
                                           + "&lt;strong&gt; Due Date: " + " "  + mylist[i].dueDate + "&lt;/strong&gt;"
                                           + "&lt;strong&gt; Mins before due: " + " "  + mylist[i].dueMinutes + "&lt;/strong&gt;"
                                           + "&lt;strong&gt; TimeZone: " + " "  + mylist[i].timezoneChoice + "&lt;/strong&gt;"
                                           + "&lt;hr&gt;" +"&lt;/div&gt;")
                                  },
  </code></pre>
  
  <p>How would I do this. Please I really need the help and have been struggling the whole day. I have read about javascript and dictionaries, but i cannot access the needed dictionary values in the loop. ? I would really appreciate if someone could give a code example. </p>
  
  <p>Thank you</p>