]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- the order in which _generate_backref() for different mappers is called
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Jan 2016 22:08:50 +0000 (17:08 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Jan 2016 22:08:50 +0000 (17:08 -0500)
is random; therefore it may be called against the subclass mapper first, so
need to check .concrete on both sides, references #3630

lib/sqlalchemy/orm/relationships.py

index 9b02d86e94cf6f5995107c6322cee0f0d055351e..83856eebf1117f2419ecc5de5abac79dd6668eef 100644 (file)
@@ -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 "