fixed sqlite regex
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 1.99.4 (2012-02-28 10:10:28) stable
|
Version 1.99.4 (2012-02-28 10:18:22) stable
|
||||||
|
|||||||
+8
-1
@@ -1693,6 +1693,10 @@ class SQLiteAdapter(BaseAdapter):
|
|||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def web2py_regexp(expression, item):
|
||||||
|
return re.compile(expression).search(item) is not None
|
||||||
|
|
||||||
def __init__(self, db, uri, pool_size=0, folder=None, db_codec ='UTF-8',
|
def __init__(self, db, uri, pool_size=0, folder=None, db_codec ='UTF-8',
|
||||||
credential_decoder=lambda x:x, driver_args={},
|
credential_decoder=lambda x:x, driver_args={},
|
||||||
adapter_args={}):
|
adapter_args={}):
|
||||||
@@ -1719,7 +1723,10 @@ class SQLiteAdapter(BaseAdapter):
|
|||||||
def connect(dbpath=dbpath, driver_args=driver_args):
|
def connect(dbpath=dbpath, driver_args=driver_args):
|
||||||
return self.driver.Connection(dbpath, **driver_args)
|
return self.driver.Connection(dbpath, **driver_args)
|
||||||
self.pool_connection(connect)
|
self.pool_connection(connect)
|
||||||
self.connection.create_function('web2py_extract', 2, SQLiteAdapter.web2py_extract)
|
self.connection.create_function('web2py_extract', 2,
|
||||||
|
SQLiteAdapter.web2py_extract)
|
||||||
|
self.connection.create_function("REGEXP", 2,
|
||||||
|
SQLiteAdapter.web2py_regexp)
|
||||||
|
|
||||||
def _truncate(self, table, mode=''):
|
def _truncate(self, table, mode=''):
|
||||||
tablename = table._tablename
|
tablename = table._tablename
|
||||||
|
|||||||
Reference in New Issue
Block a user