title: Import data from a joined table as a current (readable) column in SQLAlchemy?
body: <p>I have this schema:</p>
  <pre><code>
  class Company(db.Model):
      __tablename__  = 'companies'
  
      id              = db.Column(db.Integer, primary_key=True)
  
      name            = db.Column(db.String(250), nullable=True, default=None)
      domain          = db.Column(db.String(250), nullable=True, default=None)
  
      organization_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
  
  
  class Contact(db.Model):
      __tablename__  = 'contacts'
  
      id              = db.Column(db.Integer, primary_key=True)
  
      name            = db.Column(db.String(250), nullable=True, default=None)
      email           = db.Column(db.String(250), nullable=False)
  
      company_id      = db.Column(db.Integer, db.ForeignKey('companies.id'), nullable=True, default=None)
      company         = relationship('Company')
  
      organization_id = db.Column({Import Company.organization_id as eager})
  </code></pre>
  <p>The last line is of course garbage, but it's to show the idea:</p>
  <p>I'd like to have the value &quot;organization_id&quot; available in Contact, even though it's not present in the table &quot;contacts&quot;, but since it's present in &quot;companies&quot;, is there a way to ask SQLAlchemy to load the value from &quot;companies&quot; via a JOIN, and affect it to &quot;contacts&quot; as a read-only value?</p>
  <p>That way, when I search for a contact, for instance :</p>
  <pre><code>contact = Contact.query.filter(Contact.email = 'test@test.com').first()
  print(contact.organization_id) # =&gt; 1
  </code></pre>
  <p>Thank you.</p>