From 7b22a29602fa9d157d35c49a9666908e4672886f Mon Sep 17 00:00:00 2001 From: James Russo Date: Fri, 17 May 2024 11:35:49 -0400 Subject: [PATCH] fix: use back_populates is backref is not there --- sqlalchemy_utils/listeners.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlalchemy_utils/listeners.py b/sqlalchemy_utils/listeners.py index 02e21be0..6d91c18a 100644 --- a/sqlalchemy_utils/listeners.py +++ b/sqlalchemy_utils/listeners.py @@ -241,7 +241,7 @@ class Entry(Base): parent_class = attr.parent.class_ target_class = attr.property.mapper.class_ - backref = attr.property.backref + backref = attr.property.backref or attr.property.back_populates if not backref: raise ImproperlyConfigured( 'The relationship argument given for auto_delete_orphans needs to '