]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
assignmapper was setting is_primary=True, causing all sorts of mayhem
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 20 Jul 2006 18:25:26 +0000 (18:25 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 20 Jul 2006 18:25:26 +0000 (18:25 +0000)
by not raising an error when redundant mappers were set up, fixed

CHANGES
lib/sqlalchemy/ext/assignmapper.py
lib/sqlalchemy/orm/properties.py

diff --git a/CHANGES b/CHANGES
index 34103bf0a44fec45c3caa8dfc344d2dd3d8c820a..94b2e0e8e086a3bb635db5fd9f529550b17d5a48 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+0.2.7
+- assignmapper was setting is_primary=True, causing all sorts of mayhem
+by not raising an error when redundant mappers were set up, fixed
+
 0.2.6
 - big overhaul to schema to allow truly composite primary and foreign
 key constraints, via new ForeignKeyConstraint and PrimaryKeyConstraint
index 240a46e3b1da99c5be19a5fb04dea007ff9c51fe..5b77052e24ea5c649df9cf94416cb7a7729a9abe 100644 (file)
@@ -17,7 +17,6 @@ def monkeypatch_objectstore_method(ctx, class_, name):
     setattr(class_, name, do)
     
 def assign_mapper(ctx, class_, *args, **kwargs):
-    kwargs.setdefault("is_primary", True)
     if not isinstance(getattr(class_, '__init__'), types.MethodType):
         def __init__(self, **kwargs):
              for key, value in kwargs.items():
index c34b0223a9b9d1785eab66959fcfcf6f1b5c9b9f..5ff401d275fa3deca4c868a626fc7bf4441a3f8d 100644 (file)
@@ -206,7 +206,7 @@ class PropertyLoader(mapper.MapperProperty):
             
         if self.association is not None:
             if isinstance(self.association, type):
-                self.association = mapper.class_mapper(self.association, compile=False)
+                self.association = mapper.class_mapper(self.association, compile=False)._check_compile()
         
         self.target = self.mapper.mapped_table