]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
moved eagermapper creation up to insure theres no mapper conflicts when creating...
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 3 Dec 2005 05:29:12 +0000 (05:29 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 3 Dec 2005 05:29:12 +0000 (05:29 +0000)
test/manytomany.py

index cc521c9a89a1b6089cbc2b3e83831646b6a5ea9e..e4b599d6b51e075f125bdf36fb227b557e8e3884 100644 (file)
@@ -103,8 +103,12 @@ class ManyToManyTest(testbase.AssertMixin):
         )
         Place.mapper.add_property('inputs', relation(Transition.mapper, place_output, lazy=True))
         Place.mapper.add_property('outputs', relation(Transition.mapper, place_input, lazy=True))
-        
 
+        Place.eagermapper = Place.mapper.options(
+            eagerload('inputs', selectalias='ip_alias'), 
+            eagerload('outputs', selectalias='op_alias')
+        )
+        
         t1 = Transition('transition1')
         t2 = Transition('transition2')
         t3 = Transition('transition3')
@@ -122,10 +126,6 @@ class ManyToManyTest(testbase.AssertMixin):
         
         objectstore.commit()
 
-        Place.eagermapper = Place.mapper.options(
-            eagerload('inputs', selectalias='ip_alias'), 
-            eagerload('outputs', selectalias='op_alias')
-        )
         
         l = Place.eagermapper.select()
         print repr(l)