]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Oops, Python 2.5 ternary operator snuck in.
authorJason Kirtland <jek@discorporate.us>
Thu, 3 May 2007 21:51:34 +0000 (21:51 +0000)
committerJason Kirtland <jek@discorporate.us>
Thu, 3 May 2007 21:51:34 +0000 (21:51 +0000)
lib/sqlalchemy/ext/associationproxy.py
test/ext/associationproxy.py

index d86297bc17e18c27669059891b980bb82c7d1c25..d6a995450ac97d4a4ceb95a80412ff13f1a03444 100644 (file)
@@ -243,7 +243,10 @@ class _AssociationList(object):
         return len(self.col)
 
     def __nonzero__(self):
-        return True if self.col else False
+        if self.col:
+            return True
+        else:
+            return False
 
     def __getitem__(self, index):
         return self._get(self.col[index])
@@ -355,7 +358,10 @@ class _AssociationDict(object):
         return len(self.col)
 
     def __nonzero__(self):
-        return True if self.col else False
+        if self.col:
+            return True
+        else:
+            return False
 
     def __getitem__(self, key):
         return self._get(self.col[key])
@@ -497,7 +503,10 @@ class _AssociationSet(object):
         return len(self.col)
 
     def __nonzero__(self):
-        return True if self.col else False
+        if self.col:
+            return True
+        else:
+            return False
 
     def __contains__(self, value):
         for member in self.col:
index c4dd78463c0820131beefdd2731e2013d8461d49..b6476c836137eb3c7a9668506f97305574d336a3 100644 (file)
@@ -32,7 +32,6 @@ class ObjectCollection(object):
 class _CollectionOperations(PersistTest):
     def setUp(self):
         collection_class = self.collection_class
-        lazy = self.lazy if hasattr(self, 'lazy') else False
 
         metadata = BoundMetaData(db)
     
@@ -62,7 +61,7 @@ class _CollectionOperations(PersistTest):
                     self.name = name
 
         mapper(Parent, parents_table, properties={
-            '_children': relation(Child, lazy=lazy,
+            '_children': relation(Child, lazy=False,
                                   collection_class=collection_class)})
         mapper(Child, children_table)