title: SQLAlchemy variable relationship
body: <p>I'm unclear on how to configure SQLAlchemy for the following scenario:</p>
  
  <ul>
  <li>Several tables of varying nature.</li>
  <li>All tables need to reference a one-to-many <code>notes</code> table</li>
  <li>Would like to only have one <code>notes</code> table, servicing all these other tables, with the relationship based on a <code>parent_type</code> column in the <code>notes</code> table</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/WE3La.png" alt="Table Diagram"></p>
  
  <p>For example: if <code>relation_type</code> is <strong>items</strong>, then <code>relationship_id</code> refers to the PK of the <code>table_items</code> table. If <code>relation_type</code> is <strong>orders</strong> then <code>relationship_id</code> would refer to the PK of <code>table_orders</code></p>