]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- the type of a _BooleanExpression should always be Boolean
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 5 Jul 2007 17:28:31 +0000 (17:28 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 5 Jul 2007 17:28:31 +0000 (17:28 +0000)
- added a random generative select() to a test (need to add the real tests to either select.py or generative.py)

lib/sqlalchemy/sql.py
test/orm/query.py

index cabba25a777e46926fa8f0c06f6d0b51920cfa9d..a4808623e0f623531b61923e3e77086f8933ec37 100644 (file)
@@ -1281,7 +1281,7 @@ class _CompareMixin(object):
         else:
             obj = self._check_literal(obj)
 
-        return _BinaryExpression(self._compare_self(), obj, operator, type=self._compare_type(obj), negate=negate)
+        return _BinaryExpression(self._compare_self(), obj, operator, type=sqltypes.Boolean, negate=negate)
 
     def _operate(self, operator, obj):
         if _is_literal(obj):
index 76ba9f124a000b5f115d0212284b6b6eeae1a39f..8b006c922a205c6976a12386cadbb5a652c5db27 100644 (file)
@@ -323,7 +323,7 @@ class InstancesTest(QueryTest):
         l = q.all()
         assert l == expected
 
-        s = select([users, func.count(addresses.c.id).label('count')], from_obj=[users.outerjoin(addresses)], group_by=[c for c in users.c], order_by=[users.c.id])
+        s = select([users, func.count(addresses.c.id).label('count')]).select_from(users.outerjoin(addresses)).group_by(*[c for c in users.c]).order_by(users.c.id)
         q = sess.query(User)
         l = q.instances(s.execute(), "count")
         assert l == expected