call with_polymorphic passing in only the base class:
query.with_polymorphic(BaseClass).filter()
On Aug 25, 2008, at 10:35 AM, ml wrote:
Hi!
How can I disable a polymorphic load for a single query? I found a
hint
in http://markmail.org/message/2kwbm377j3pdvvqb but I can't find
This is not working:
Setup:
base = Table(base, metadata,
Column(id, Integer, primary_key=True),
Column(kind, Integer),
)
derived = Table(derived, metadata,
Column(id, Integer, ForeignKey(base.id), primary_key=True)
oh, that. OK, in the 0.4 series you'd want to set
polymorphic_fetch='deferred' on your mapper. Just leave it that
way, as the non-deferred behavior has been removed from 0.5 anyway
(its deferred in all cases). The second table will be fetched as
needed.
if you're depending heavily on
I'm heavily using the polymorphic features but I need a stable library
so I will stick with 0.4 for now.
Thank you!
David
Michael Bayer napsal(a):
oh, that. OK, in the 0.4 series you'd want to set
polymorphic_fetch='deferred' on your mapper. Just leave it that
way, as the