title: SQLAlchemy; getting list of related tables/classes
body: <p>Say I have a <code>Thing</code> class that is related to some other classes, <code>Foo</code> and <code>Bar</code>.</p>
  
  <pre><code>class Thing(Base):
  FooKey = Column('FooKey', Integer,
                         ForeignKey('FooTable.FooKey'), primary_key=True)
  BarKey = Column('BarKey', Integer, ForeignKey('BarTable.BarKey'), primary_key=True)
  foo = db.relationship('Foo')
  bar = db.relationship('Bar')
  </code></pre>
  
  <p>I want to get a list of the classes/tables related to <code>Thing</code> created by my <code>relationships()</code> e.g. <code>[Foo, Bar]</code>. Any way to do this?</p>
  
  <p>This is a closely related question:
  <a href="https://stackoverflow.com/questions/21206818/sqlalchemy-flask-get-relationships-from-a-db-model">SQLAlchemy, Flask: get relationships from a db.Model</a>. That identifies the string names of the relationships, but not the target classes.</p>
  
  <p>Context:
  I'm building unit tests for my declarative base mapping of a SQL database. A lot of dev work is going into it and I want robust checks in place.</p>