title: Sort dictionary of dictionaries by value
body: <p>I have this dictionary:</p>
  
  <pre><code>statuses = {
              'pending' : {'status_for':'all', 'position':1},
              'cancelled' : {'status_for':'all','position':2},
              'approved' : {'status_for':'owner', 'position':1},
              'rejected - owner' : {'status_for':'owner', 'position':2},
              'accepted' : {'status_for':'dev', 'position':1},
              'rejected - developer' : {'status_for':'dev', 'position':3},
              'closed' : {'status_for':'dev', 'position':5},
              }
  </code></pre>
  
  <p>I've also got a function to pull all <code>status_for</code> values of either <code>owner</code> or <code>dev</code> that looks like this and put it into a PyQt QComboBox:</p>
  
  <pre><code>for s in statuses:
              if statuses[s]['status_for'] == "dev" or statuses[s]['status_for'] == "all":
                  cb_developer_status.addItem(s.capitalize(), s)   
  </code></pre>
  
  <p>I'd like to order these by the <code>position</code> value though. What is a good way to do this, so that when I populate by combobox I have it in a predefined order?</p>
  
  <p>I realize that the snippet above is checking for both 'dev' and 'all', my assumption right now is that I'd have to loop through the dictionary twice to get the two separate blocks in the order I wish (ie. 'all' appears before 'dev').</p>
  
  <p>I saw <a href="https://stackoverflow.com/questions/613183/python-sort-a-dictionary-by-value">this post</a>, but I'm not sure how to convert this answer to something that 
  is a dictionary of dictionaries.</p>