git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6eb2f59
)
- added support for wildcards in dictionary filters
author
Tony Mack
<tmack@cs.princeton.edu>
Wed, 29 Nov 2006 19:46:58 +0000
(19:46 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Wed, 29 Nov 2006 19:46:58 +0000
(19:46 +0000)
PLC/Filter.py
patch
|
blob
|
history
diff --git
a/PLC/Filter.py
b/PLC/Filter.py
index
139da58
..
4ed819b
100644
(file)
--- a/
PLC/Filter.py
+++ b/
PLC/Filter.py
@@
-74,7
+74,11
@@
class Filter(Parameter, dict):
if value is None:
operator = "IS"
value = "NULL"
- else:
+ elif not isinstance(value, bool) \
+ and (value.find("*") > -1 or value.find("%") > -1):
+ operator = "LIKE"
+ value = str(api.db.quote(value.replace("*", "%")))
+ else:
operator = "="
value = str(api.db.quote(value))