From 51f128d499e2b119bb498aae2d3d2f7d4e077745 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Sat, 9 Mar 2013 22:03:28 -0500 Subject: [PATCH] ensure that a column exists in the table before attempting to filter on it --- PLC/Storage/AlchemyObject.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PLC/Storage/AlchemyObject.py b/PLC/Storage/AlchemyObject.py index ed9eca8a..88b505e4 100644 --- a/PLC/Storage/AlchemyObject.py +++ b/PLC/Storage/AlchemyObject.py @@ -88,7 +88,9 @@ class AlchemyObj(Record): for (field, value) in filter.items(): if isinstance(value, list): if value: - constraints.append(table.columns.get(field).in_(value)) + column = table.columns.get(field) + if isinstance(column, Column): + constraints.append(column.in_(value)) else: constraints.append(table.columns.get(field) == value) if not constraints: -- 2.47.0