From: Tony Mack Date: Sun, 10 Mar 2013 03:03:28 +0000 (-0500) Subject: ensure that a column exists in the table before attempting to filter on it X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=51f128d499e2b119bb498aae2d3d2f7d4e077745;p=plcapi.git ensure that a column exists in the table before attempting to filter on it --- 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: