fixed issue 1587:Mongodb error on id

This commit is contained in:
mdipierro
2013-07-17 07:37:38 -05:00
parent cd14782641
commit 63ca73d6f0
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.6.0-development+timestamp.2013.07.16.13.14.21
Version 2.6.0-development+timestamp.2013.07.17.07.36.50
+2 -1
View File
@@ -5540,8 +5540,9 @@ class MongoDBAdapter(NoSQLAdapter):
filter = None
if query:
filter = self.expand(query)
# do not try to update id fields to avoid backend errors
modify = {'$set': dict((k.name, self.represent(v, k.type)) for
k, v in fields)}
k, v in fields if (not k.name in ("_id", "id")))}
return modify, filter
def update(self, tablename, query, fields, safe=None):
+1 -1
View File
@@ -80,7 +80,7 @@ def compare(a, b):
def md5_hash(text):
""" Generate a md5 hash with the given text """
return md5(text).hexdigest()
return md5.new(text).hexdigest()
def simple_hash(text, key='', salt='', digest_alg='md5'):