when the Session.is_active is True.
[ticket:2241]
+ - Fixed previously untested function which regressed
+ in 0.7, can now make a synonym() of a synonym()
+ again.
+
- Identity map .discard() uses dict.pop(,None)
internally instead of "del" to avoid KeyError/warning
during a non-determinate gc teardown [ticket:2267]
if self.comparator_factory:
comp = self.comparator_factory(prop, mapper)
+ elif isinstance(prop, DescriptorProperty):
+ comp = prop._comparator_factory(mapper)
else:
comp = prop.comparator_factory(prop, mapper)
return comp
eq_(User.uname.attribute, 123)
eq_(User.uname['key'], 'value')
+ def test_synonym_of_synonym(self):
+ users, User = (self.tables.users,
+ self.classes.User)
+
+ mapper(User, users, properties={
+ 'x':synonym('id'),
+ 'y':synonym('x')
+ })
+
+ s = Session()
+ u = s.query(User).filter(User.y==8).one()
+ eq_(u.y, 8)
+
+
def test_synonym_column_location(self):
users, User = self.tables.users, self.classes.User