From 04cc0c829f44b876c439d641426545053f5ca608 Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Tue, 7 Jan 2025 18:27:32 +0000 Subject: [PATCH] Add support for composite columns --- sqlalchemy_utils/listeners.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sqlalchemy_utils/listeners.py b/sqlalchemy_utils/listeners.py index 02e21be0..e14cc3f7 100644 --- a/sqlalchemy_utils/listeners.py +++ b/sqlalchemy_utils/listeners.py @@ -10,6 +10,8 @@ def coercion_listener(mapper, class_): """ for prop in mapper.iterate_properties: try: + if not prop.columns: + continue listener = prop.columns[0].type.coercion_listener except AttributeError: continue