From d8ca865f17e466dcc311ca687707e2f1afbf9f0d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 20 Jul 2006 18:25:26 +0000 Subject: [PATCH] assignmapper was setting is_primary=True, causing all sorts of mayhem by not raising an error when redundant mappers were set up, fixed --- CHANGES | 4 ++++ lib/sqlalchemy/ext/assignmapper.py | 1 - lib/sqlalchemy/orm/properties.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 34103bf0a4..94b2e0e8e0 100644 --- 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 diff --git a/lib/sqlalchemy/ext/assignmapper.py b/lib/sqlalchemy/ext/assignmapper.py index 240a46e3b1..5b77052e24 100644 --- a/lib/sqlalchemy/ext/assignmapper.py +++ b/lib/sqlalchemy/ext/assignmapper.py @@ -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(): diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py index c34b0223a9..5ff401d275 100644 --- a/lib/sqlalchemy/orm/properties.py +++ b/lib/sqlalchemy/orm/properties.py @@ -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 -- 2.47.3