from SelectResults isn't present anymore, need to use join().
- postgres
- Added PGArray datatype for using postgres array datatypes
+
+0.3.10
+- sql
+ - got connection-bound metadata to work with implicit execution
+ - foreign key specs can have any chararcter in their identifiers
+ [ticket:667]
+ - added commutativity-awareness to binary clause comparisons to
+ each other, improves ORM lazy load optimization [ticket:664]
+- orm
+ - cleanup to connection-bound sessions, SessionTransaction
+- postgres
+ - fixed max identifier length (63) [ticket:571]
+
0.3.9
- general
- better error message for NoSuchColumnError [ticket:607]
return (
isinstance(other, _BinaryExpression) and self.operator == other.operator and
- self.left.compare(other.left) and self.right.compare(other.right)
+ (
+ self.left.compare(other.left) and self.right.compare(other.right)
+ or (
+ self.operator in ['=', '!=', '+', '*'] and
+ self.left.compare(other.right) and self.right.compare(other.left)
+ )
+ )
)
def self_group(self, against=None):
def test_uses_get(self):
"""test that a simple many-to-one lazyload optimizes to use query.get()."""
- mapper(Address, addresses, properties = dict(
- user = relation(mapper(User, users), lazy=True)
- ))
+ for pj in (
+ None,
+ users.c.id==addresses.c.user_id,
+ addresses.c.user_id==users.c.id
+ ):
+ mapper(Address, addresses, properties = dict(
+ user = relation(mapper(User, users), lazy=True, primaryjoin=pj)
+ ))
- sess = create_session()
+ sess = create_session()
- # load address
- a1 = sess.query(Address).filter_by(email_address="ed@wood.com").one()
+ # load address
+ a1 = sess.query(Address).filter_by(email_address="ed@wood.com").one()
- # load user that is attached to the address
- u1 = sess.query(User).get(8)
+ # load user that is attached to the address
+ u1 = sess.query(User).get(8)
+
+ def go():
+ # lazy load of a1.user should get it from the session
+ assert a1.user is u1
+ self.assert_sql_count(testbase.db, go, 0)
+ clear_mappers()
- def go():
- # lazy load of a1.user should get it from the session
- assert a1.user is u1
- self.assert_sql_count(testbase.db, go, 0)
-
def test_many_to_one(self):
mapper(Address, addresses, properties = dict(
user = relation(mapper(User, users), lazy=True)