Re: [sqlalchemy] inheritied table with related field as discriminator?

2013-01-29 Thread Michael Bayer
it doesn't produce as efficient of a SQL query, and requires that you set "Type" manually on the object, but you can use a correlated subquery using this form: from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base Base = declarative_base()

[sqlalchemy] inheritied table with related field as discriminator?

2013-01-28 Thread Ben Hitz
Can I use a field from a related table as the polymorphic descriminator? This code no works: http://pastebin.com/LtRC2tSR Schematically: class Reference: reference_id reference_name class Parent: parent_id reference_id(ForeignKey='reference.reference_id') reference = relatio