simpled int to hex conversion of mongo id, thanks Alan
This commit is contained in:
1 parent
a6e8111484
commit
d6e63b4d7c
2 files changed
+2
-6
No files matched your search
@@ -1 +1 @@
|
|||||||
Version 2.7.4-stable+timestamp.2013.11.16.11.51.18
|
Version 2.7.4-stable+timestamp.2013.11.17.09.20.20
|
||||||
+1
-5
@@ -5552,11 +5552,7 @@ class MongoDBAdapter(NoSQLAdapter):
|
|||||||
if not isinstance(arg, (int, long)):
|
if not isinstance(arg, (int, long)):
|
||||||
raise TypeError("object_id argument must be of type " +
|
raise TypeError("object_id argument must be of type " +
|
||||||
"ObjectId or an objectid representable integer")
|
"ObjectId or an objectid representable integer")
|
||||||
if arg == 0:
|
hexvalue = hex(arg)[2:].rstrip('L').zfill(24)
|
||||||
hexvalue = "".zfill(24)
|
|
||||||
else:
|
|
||||||
hexvalue = hex(arg
|
|
||||||
).split("x")[-1].replace("L", "").zfill(24)
|
|
||||||
return self.ObjectId(hexvalue)
|
return self.ObjectId(hexvalue)
|
||||||
|
|
||||||
def parse_reference(self, value, field_type):
|
def parse_reference(self, value, field_type):
|
||||||
|
|||||||
Reference in new issue
Block a user