[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, debian, updated. upstream/0.9.5.5-717-g0f98819

Sebastian Krzyszkowiak seba.dos1 at gmail.com
Sat Aug 6 08:20:18 UTC 2011


The following commit has been merged in the debian branch:
commit d86559177558de4508c01656b1fc9aede759aac0
Author: Marco Trevisan (Treviño) <mail at 3v1n0.net>
Date:   Wed Dec 15 02:04:01 2010 +0100

    opimd: add more query operator support
    
    Now you can also query with more operators using:
     field >= val   with   {">=field", "val"}
     field <= val   with   {"<=field", "val"}
     field != val   with   {"!field", "val"}
    
    Signed-off-by: Sebastian Krzyszkowiak <seba.dos1 at gmail.com>

diff --git a/framework/subsystems/opimd/db_handler.py b/framework/subsystems/opimd/db_handler.py
index 0622848..070850c 100644
--- a/framework/subsystems/opimd/db_handler.py
+++ b/framework/subsystems/opimd/db_handler.py
@@ -214,7 +214,8 @@ class DbHandler(object):
             return " value " + operator + " ? "
         else:
             #FIXME: raise error if operator is not '='
-            return " regex_matches(value, ?) = 1 "
+            if (operator == '!=' or operator == "="):
+                return " regex_matches(value, ?) "+operator+" 1 "
     def get_value_compare_object(self, type, field, value):
         if type == "phonenumber":
             return normalize_number(str(value))
@@ -289,7 +290,13 @@ class DbHandler(object):
             
             #handle type searching
             if name.startswith('<') or name.startswith('>'):
-                operator = name[:1]
+                pos = 1
+                if (name[1] == '='):
+                    pos = 2
+                operator = name[:pos]
+                name = name[pos:]
+            elif name.startswith('!'):
+                operator = '!='
                 name = name[1:]
             else:
                 operator = '='

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list