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;
Jeroen,
You have probably already found this work around, but I will go ahead and document it here in the bug.
__ storm_table_ _ = "other_table"
__ storm_table_ _ = "table"
other_ ref_id = Property( "column1_ ref_id" )
other_ ref = Reference( other_ref_ id, Other.prop1) self.Class, "alias")
With this table structure:
class Other(object):
prop1 = Property("column1", primary=True)
class Class(object):
prop1 = Property("column1", primary=True)
ClassAlias = ClassAlias(
store.find( ClassAlias. prop1, ClassAlias. other_ref == 1) .column1_ ref_id = 1; ClassAlias. prop1, ClassAlias. other_ref_ id == 1) ref_id = 1;
will generate WHERE "table"
But, store.find(
will generate WHERE alias.column1_