Re: [sqlalchemy] Is querying a relationship on an AbstractBaseClass possible?

2013-03-01 Thread Derek Litz
Sorry, was out due to moving... BLEH. I like second solution since I then don't need to declare the relationship on every sub class. Basicly: 1. Configure as I had previously 2. Make sure configure_mappers() is ran after all sub classes are declared. 3. Monkey Wrench the base

[sqlalchemy] Is querying a relationship on an AbstractBaseClass possible?

2013-02-27 Thread Derek Litz
Having fun with AbstractBaseClasses tonight :) ... Anyways am I missing something here as well? I tried playing with querying the AbstractBaseClass and filtering on sub classes but that just produced a query that did not execute. from sqlalchemy.engine import Engine from sqlalchemy import

Re: [sqlalchemy] Is querying a relationship on an AbstractBaseClass possible?

2013-02-27 Thread Michael Bayer
just features that weren't anticipated (I never use concrete inheritance). here's what will work for now. class AbstractConcreteAbstraction(AbstractConcreteBase, sqlite): __table_args__ = (UniqueConstraint('derpa', 'derp'),) id = Column(Integer, primary_key=True) derpa =

Re: [sqlalchemy] Is querying a relationship on an AbstractBaseClass possible?

2013-02-27 Thread Michael Bayer
simpler, just stick the relationship on ACA: session = Session(engine) print session.query(ConcreteConcreteAbstraction).filter( ConcreteConcreteAbstraction.something.has(id=1)).all() AbstractConcreteAbstraction.something = relationship(Something) print