title: SQLAlchemy UnmappedClassError: Class 'sqlalchemy.ext.declarative.DeclarativeMeta' is not mapped
body: <p>I'm using model inheritance in my project.</p>
  
  <p>My models:</p>
  
  <pre><code>class CommentBase(Base):
      __abstract__ = True
  
      id = Column(Integer, primary_key=True)
      text = Column(Unicode(500))
  
      @declared_attr
      def user_id(cls):
          return Column(ForeignKey('user.id'))
  
      @declared_attr
      def user(cls):
          return relationship('User')
  
      def __init__(self, user_id, text):
          self.user_id = user_id
          self.text = text
  
  class CommentOne(CommentBase):
      __tablename__ = 'comment_one'
  
  class CommentTwo(CommentBase):
      __tablename__ = 'comment_two'
  </code></pre>
  
  <p>All tables creates correctly, but when I try to populate tables (even those which don't inherit from others) with some test data it raises an error:</p>
  
  <blockquote>
    <p><strong>UnmappedClassError</strong>: Class <strong>'sqlalchemy.ext.declarative.DeclarativeMeta'</strong> is not mapped</p>
  </blockquote>
  
  <p>Here is my <code>Base</code>:</p>
  
  <pre><code>Base = declarative_base()
  </code></pre>
  
  <p>Without inheritance all works as it should be.
  How to fix it?</p>
  
  <p>Thaks in advance!</p>