From: Mike Bayer Date: Tue, 19 Jan 2016 22:08:50 +0000 (-0500) Subject: - the order in which _generate_backref() for different mappers is called X-Git-Tag: rel_1_1_0b1~84^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a279e7ae4417062bf4b73921f382c5e5e415a0b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - the order in which _generate_backref() for different mappers is called is random; therefore it may be called against the subclass mapper first, so need to check .concrete on both sides, references #3630 --- diff --git a/lib/sqlalchemy/orm/relationships.py b/lib/sqlalchemy/orm/relationships.py index 9b02d86e94..83856eebf1 100644 --- a/lib/sqlalchemy/orm/relationships.py +++ b/lib/sqlalchemy/orm/relationships.py @@ -1821,7 +1821,7 @@ class RelationshipProperty(StrategizedProperty): check = set(mapper.iterate_to_root()).\ union(mapper.self_and_descendants) for m in check: - if m.has_property(backref_key): + if m.has_property(backref_key) and not m.concrete: raise sa_exc.ArgumentError( "Error creating backref " "'%s' on relationship '%s': property of that "