title: SQLAlchemy column_property exist in table
body: <p>Let's suppose I have three tables.</p>
  
  <pre><code>class A(Base):
    id = Column(Integer, primary_key=True)
    bs = association_proxy("a_b", "b")
  
  class B(Base):
    id = Column(Integer, primary_key=True)
    extra = Column(String(10), nullable=True)
    as = association_proxy("a_b", "a")
  
  class A_B(Base):
    __table_args__ = (
      UniqueConstraint('a_id', 'b_extra'),
      )
    a_id = Column(Integer, ForeignKey('A.id'), primary_key=True)
    b_id = Column(Integer, ForeignKey('B.id'), primary_key=True)
    b_extra = column_property(
      select([B.extra]).where(B.id=b_id)
      )
    b = relationship("B", backref="a_b")
    a = relationship("A", backref="a_b")
  </code></pre>
  
  <p>And a database schema:</p>
  
  <pre><code>CREATE TABLE A (
    id INT(11) NOT NULL AUTO_INCREMENT,
    PRIMARY KEY (id)
  )
  CREATE TABLE B (
    id INT(11) NOT NULL AUTO_INCREMENT,
    extra INT(11) NOT NULL,
    PRIMARY KEY (id)
  )
  CREATE TABLE A_B (
    a_id INT(11) NOT NULL,
    b_id INT(11) NOT NULL,
    b_extra INT(11) NOT NULL,
    UNIQUE KEY ('a_id', 'b_extra'),
    KEY a_id,
    KEY b_id,
    CONSTRAINT FOREIGN KEY ('b_extra') REFERENCES 'B' ('extra'),
    CONSTRAINT FOREIGN KEY ('b_id') REFERENCES 'B' ('id'),
    CONSTRAINT FOREIGN KEY ('a_id') REFERENCES 'A' ('id')
  )
  </code></pre>
  
  <p>The idea is that A_B is an association table between A and B. The extra data in B is not unique per B, but it <em>is</em> unique per A. The problem I am having with this is that when I try to run the script I get <code>Key Error: b_extra</code>. I've tried every dirty trick I could think of, but I'm at a loss as to how to fix this.</p>
  
  <p>Edit: To clarify, I want the column_property to exist in the database and participate in updates and inserts like normal.</p>
  
  <p>This is a slightly simplified example from what the real application is, as it's too complex to post here.</p>