fixed Issue 1526:MongoDBAdapter contains() doesn't work for list:reference types, thanks schlegel

This commit is contained in:
mdipierro
2013-06-13 15:30:59 -05:00
parent 98c19740a2
commit c0ba74dd88
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.5.1-stable+timestamp.2013.06.13.15.20.01
Version 2.5.1-stable+timestamp.2013.06.13.15.30.17
+3 -2
View File
@@ -5704,8 +5704,9 @@ class MongoDBAdapter(NoSQLAdapter):
# silently ignore, only case sensitive
# There is a technical difference, but mongodb doesn't support
# that, but the result will be the same
return {self.expand(first) : ('/%s/' % \
self.expand(second, 'string'))}
val = second if isinstance(second,self.ObjectId) else \
{' $regex':".*" + re.escape(self.expand(second, 'string')) + ".*"}
return {self.expand(first) : val}
def LIKE(self, first, second):
import re