Comment 6 for bug 682989

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Jeroen,

You have probably already found this work around, but I will go ahead and document it here in the bug.
With this table structure:
        class Other(object):
            __storm_table__ = "other_table"
            prop1 = Property("column1", primary=True)
        class Class(object):
            __storm_table__ = "table"
            prop1 = Property("column1", primary=True)
            other_ref_id = Property("column1_ref_id")
            other_ref = Reference(other_ref_id, Other.prop1)
        ClassAlias = ClassAlias(self.Class, "alias")

store.find(ClassAlias.prop1, ClassAlias.other_ref == 1)
will generate WHERE "table".column1_ref_id = 1;
But, store.find(ClassAlias.prop1, ClassAlias.other_ref_id == 1)
will generate WHERE alias.column1_ref_id = 1;