title: sqlAlchemy, concrete inheritance, but parent has foreignKey
body: <p>i have 3 classes: </p>
  
  <ul>
  <li>User       </li>
  <li>Employee   &lt;-- not required in the DB</li>
  <li>Manager</li>
  </ul>
  
  <p>Manager inherits from Employee.   User table is <strong>not</strong> related to the inheritance.</p>
  
  <p>So far so good:</p>
  
  <pre class="lang-python prettyprint-override"><code>class User(Base):
      __tablename__ = 'user'
      id = Column(Integer, primary_key=True)
      email = Column(String(255))
  
  class Employee(AbstractConcreteBase, Base):
      name = Column(String(30))
  
  class Manager(Employee):
      __tablename__ = 'manager'
      employee_id = Column(Integer, primary_key=True)
      dept = Column(String(30))
      __mapper_args__ = {'polymorphic_identity':'manager', 'concrete':True}
  </code></pre>
  
  <p>It creates User and Manager, which is what I want.</p>
  
  <p>But,</p>
  
  <p>The above breaks if we introduce a ForeignKey in the parent class:</p>
  
  <pre><code>class Employee(AbstractConcreteBase, Base):
      name = Column(String(30))
      user_id = Column(Integer, ForeignKey('user.id'))        
  </code></pre>
  
  <p>the error is:</p>
  
  <p>sqlalchemy.exc.InvalidRequestError: </p>
  
  <pre><code>Columns with foreign keys to other columns must be declared as @declared_attr callables on declarative mixin classes.
  </code></pre>
  
  <p>so far, I didn't understand <strong><a href="http://docs.sqlalchemy.org/en/rel_1_0/orm/extensions/declarative/mixins.html" rel="noreferrer">the mixin docs (link)</a></strong></p>
  
  <p>What do I need to allow a foreign-key in my base class (Employee, in this case) ?</p>