query(A).join(A.bs).filter(B.foo=='bar'), were erroneously
adapting "B.foo" as though it were an "A".
+ - Fixed adaptation of EXISTS clauses via any(), has(), etc.
+ in conjunction with an aliased object on the left and
+ of_type() on the right. [ticket:1325]
+
- Added an attribute helper method ``set_committed_value`` in
sqlalchemy.orm.attributes. Given an object, attribute name,
and value, will set the value on the object as part of its
return op(self, *other, **kwargs)
def of_type(self, cls):
- return RelationProperty.Comparator(self.property, self.mapper, cls)
+ return RelationProperty.Comparator(self.property, self.mapper, cls, adapter=self.adapter)
def in_(self, other):
raise NotImplementedError("in_() not yet supported for relations. For a "
source_selectable = self.__clause_element__()
else:
source_selectable = None
-
+
pj, sj, source, dest, secondary, target_adapter = \
self.property._create_joins(dest_polymorphic=True, dest_selectable=to_selectable, source_selectable=source_selectable)
sess.query(Company).filter(Company.employees.of_type(Engineer).any(Engineer.primary_language=='cobol')).one(),
c2
)
+
+ calias = aliased(Company)
+ self.assertEquals(
+ sess.query(calias).filter(calias.employees.of_type(Engineer).any(Engineer.primary_language=='cobol')).one(),
+ c2
+ )
self.assertEquals(
sess.query(Company).filter(Company.employees.of_type(Boss).any(Boss.golf_swing=='fore')).one(),