title: How to sort list based off of a join to another table
body: <p>I have a table that needs to be sorted alphabetically by names that aren't actually contained in the table <strong>in sqlalchemy</strong>.  Only codes representing the names are in the table.  Like so...</p>
  
  <p>Table 1:</p>
  
  <pre><code>row  code  month   value
  1    A     201501  50
  2    Z     201501  100
  3    CO    201501  200
  4    VA    201502  300
  5    C     201502  300
  </code></pre>
  
  <p>Table 2:</p>
  
  <pre><code>row  code  name
  1    A     Apple
  2    C     Cascade
  3    CO    Colorado
  4    VA    Virginia
  </code></pre>
  
  <p>I need to sort <strong>Table 1</strong> the following:</p>
  
  <ul>
  <li>month</li>
  <li>name (found in Table 2)</li>
  </ul>
  
  <p>What is the best technique to achieve these sorting results when the sorting occurs on value not inherent in the table.  I can't send the joined product of Table 1 and Table 2.  Although, I can join them temporarily and remove the 'name' column if needed.</p>