Re: [sqlalchemy] with_polymorphic query and parent attribute filtering

2012-11-14 Thread tonthon
Le 14/11/2012 06:19, Michael Bayer a écrit : > On Nov 13, 2012, at 3:34 AM, tonthon wrote: > >> Hi, >> >> I'm using polymorphism for some of my models and I'm wondering how I >> should use the with_polymorphic query method. >> >> Consider the following: >> """ >> class A(Base): >> type_ = Column(

Re: [sqlalchemy] with_polymorphic query and parent attribute filtering

2012-11-13 Thread Michael Bayer
On Nov 13, 2012, at 3:34 AM, tonthon wrote: > Hi, > > I'm using polymorphism for some of my models and I'm wondering how I > should use the with_polymorphic query method. > > Consider the following: > """ > class A(Base): > type_ = Column(Integer, nullable=False) > arg = Column(String(20))

[sqlalchemy] with_polymorphic query and parent attribute filtering

2012-11-13 Thread tonthon
Hi, I'm using polymorphism for some of my models and I'm wondering how I should use the with_polymorphic query method. Consider the following: """ class A(Base): type_ = Column(Integer, nullable=False) arg = Column(String(20)) __mapper_args__ = {'polymorphic_on': type_, 'polymorphic_ident