title: Converting a nested dictionary to a list
body: <p>I know there are many dict to list questions on here but I can't quite find the information I need for my situation so I'm asking a new quetion.</p>
  
  <p>Some background: I'm using a hierarchical package for my models and the built-in function which generates the tree structure outputs a nested loop to indicate parents, children, etc. My goal is to keep the logic in views and output a list so that I can simply loop over it in my templates.</p>
  
  <p>Here is my data, in the tree structure:</p>
  
  <pre><code>1
  -1.1
  --1.1.1
  ---1.1.1.1
  --1.1.2
  -1.2
  --1.2.1
  --1.2.2
  -1.3
  </code></pre>
  
  <p>Here is the nested dictionary I am getting as a result</p>
  
  <pre><code>{
   &lt;Part: 1.1&gt;:
   {
     &lt;Part: 1.1.1&gt;:
       {
         &lt;Part: 1.1.1.1&gt;: {}
       }, 
     &lt;Part: 1.1.2&gt;: {}
   },
   &lt;Part: 1.2&gt;: 
   {
     &lt;Part: 1.2.1&gt;: {},
     &lt;Part: 1.2.2&gt;: {}
   }, 
   &lt;Part: 1.3&gt;: {}
  }
  </code></pre>
  
  <p>or if you don't like the way I tried to break it up, here is what I get in a single line:</p>
  
  <pre><code>{&lt;Part: 1.1&gt;: {&lt;Part: 1.1.1&gt;: {&lt;Part: 1.1.1.1&gt;: {}}, &lt;Part: 1.1.2&gt;: {}}, &lt;Part: 1.2&gt;: {&lt;Part: 1.2.1&gt;: {}, &lt;Part: 1.2.2&gt;: {}}, &lt;Part: 1.3&gt;: {}}
  </code></pre>
  
  <p>What I'd like is to get:</p>
  
  <pre><code>[&lt;Part: 1.1&gt;, &lt;Part: 1.1.1&gt;, &lt;Part: 1.1.1.1&gt;, &lt;Part: 1.1.2&gt;, &lt;Part: 1.2&gt;, &lt;Part: 1.2.2&gt;, &lt;Part: 1.2.1&gt;, &lt;Part: 1.3&gt;,]
  </code></pre>
  
  <p>I've tried just iterating over the key in <code>dict.items</code> but then I only get the top level keys <code>(1.1, 1.2, 1.3)</code>
  <p>What do I need to do to get deeper?</p>
  
  <p><p>thanks!</p>