title: Accessing sqlalchemy Foreign Key relationship information programmatically
body: <p>I'm trying to build tests for flask-sqlalchemy models to confirm they match the tables in the database. Using reflection, I can get the db tables, columns, and foreign keys. With the models I know how to check tablename and column names, but I can't figure out how to see the defined foreign key relationships programatically.</p>
  <p>Model example:</p>
  <pre><code>class Example(db.Model):
      __table_args__ = {'schema': 'defined_schema'}
      __tablename__ = 'example'
  
      id =          db.Column(db.BigInteger, primary_key=True)
      name =        db.Column(db.String)
      info =        db.Column(db.BigInteger, db.ForeignKey(Info.id))
      descr =       db.Column(db.String)
  </code></pre>
  <p>Given a Model m, I've tried:</p>
  <pre><code>dir(m)
  m.__dict__
  </code></pre>