Re: [sqlalchemy] Query filter for class in inheritance mapping?

2018-05-30 Thread Mike Bayer
On Wed, May 30, 2018 at 3:17 PM, Derek Lambert wrote: > That's what I do in most circumstances. In this case I'm building a more > complicated query and was hoping to do something like > > sess.query(Employee).filter( > or_( > and_(isclass(Manager), Manager.name.startswith('Jo')), >

Re: [sqlalchemy] Query filter for class in inheritance mapping?

2018-05-30 Thread Derek Lambert
That's what I do in most circumstances. In this case I'm building a more complicated query and was hoping to do something like sess.query(Employee).filter( or_( and_(isclass(Manager), Manager.name.startswith('Jo')), and_(isclass(Engineer), Engineer.engineer_info.startswith('D

Re: [sqlalchemy] Query filter for class in inheritance mapping?

2018-05-30 Thread Mike Bayer
On Wed, May 30, 2018 at 12:39 PM, Derek Lambert wrote: > Outside of checking the discriminator value is it possible to filter a query > by a class in an inheritance mapping? > > class Employee(Base): > __tablename__ = 'employee' > id = Column(Integer, primary_key=True) > name = Column(

[sqlalchemy] Query filter for class in inheritance mapping?

2018-05-30 Thread Derek Lambert
Outside of checking the discriminator value is it possible to filter a query by a class in an inheritance mapping? class Employee(Base): __tablename__ = 'employee' id = Column(Integer, primary_key=True) name = Column(String(50)) type = Column(String(20)) __mapper_args__ = {