title: Sqlachemy. How to query results a list of two models?
body: <p>there are models.</p>
  
  <pre><code>class CMiixin(objects):
  
      @declared_attr
      def x(cls):
          return Column(Float)
  
  
  class ABase(Base):
      __tablename__ = 'a_base'
  
      @declared_attr
      def __mapper_args__(cls):
          return {'polymorphic_identity': '%s' % cls.__tablename__,
                  'polymorphic_on': cls.type,
                  'with_polymorphic': '*'}
  
      id = Column(Integer, primary_key= True)
      type = Column(String)
      # other attr
  
  class A(CMixin, ABase):
      __tablename__ = 'a'
  
      id = Column(ForeignKey('a_base.id'), primary_key= True)
      # other attr    
  
  class BBase(Base):
      __tablename__ = 'b_base'
  
      @declared_attr
      def __mapper_args__(cls):
          return {'polymorphic_identity': '%s' % cls.__tablename__,
                  'polymorphic_on': cls.type,
                  'with_polymorphic': '*'}
  
      id = Column(Integer, primary_key= True)
      type = Column(String)
      # other attr
  
  class B(CMixin, ABase):
      __tablename__ = 'b'
  
      id = Column(ForeignKey('b_base.id'), primary_key= True)
      # other attr        
  </code></pre>
  
  <p>How to choose a single query A and B with x(attribute CMixin) &lt;= 5?
  something this
          db.session.query(???).filter(A.x &lt;= 5, B.x &lt;= 5).all()
          result list at A and B objects
  Or is it impossible to do, and just add the
  results of two queries?</p>