X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FFilter.py;h=41f89a628f42ad1ec4420143bec5ec4428fe3409;hb=6e915d8a9ac5474c20482751ab6d24e6ce13aec9;hp=5c4557208f02ba769cf77d2e2a0ef61e199d9f03;hpb=647e5fff4e77d6139637a483b3d74cee597060de;p=plcapi.git diff --git a/PLC/Filter.py b/PLC/Filter.py index 5c45572..41f89a6 100644 --- a/PLC/Filter.py +++ b/PLC/Filter.py @@ -1,7 +1,6 @@ # # Thierry Parmentelat - INRIA # -from types import StringTypes import time from PLC.Faults import * @@ -70,9 +69,9 @@ class Filter(Parameter, dict): * similarly the two special keys below allow to change the semantics of multi-keys filters * '-AND' : select rows that match ALL the criteria (default) * '-OR' : select rows that match ANY criteria - The value attached to these keys is ignored. + The value attached to these keys is ignored. Please note however that because a Filter is a dict, you cannot provide two criteria on a given key. - + Here are a few realistic examples @@ -167,7 +166,7 @@ class Filter(Parameter, dict): if value is None: operator = "IS" value = "NULL" - elif isinstance(value, StringTypes) and \ + elif isinstance(value, str) and \ (value.find("*") > -1 or value.find("%") > -1): operator = "ILIKE" # insert *** in pattern instead of either * or %