gnowledge/gstudio — pull request #356 by AvadootNachankar (2014-04-11 07:40:29+00:00)
Title: Bug Resolved: Editing collections -- [Getting {'$oid': "24-digit-hexstring"} instead of ObjectId()]

**Bug information:**

1) When retrieving from history, it was not converting json-formatted ObjectId [{'$oid': "24-digit-hexstring"}] into mongodb-formatted ObjectId [ObjectId("24-digit-hexstring")]
- This problem occurs when we convert mongodb's document into json-format using mongokit's to_json_type() function
- It converts ObjectId() type into corresponding format "{u'$oid': u'24-digit-hexstring'}"
- But this bug arises only when a given attribute-field's data-type is "list of ObjectIds"
- In case of '_id' field (automatically created by mongodb), mongokit handles this conversion and does so
- But not in case of "list of ObjectIds", it still remains in above given format and causes problem

**Files modified:**

1) models.py
- get_version_document() function updated: Temporarily basis, it finds '$oid' and converts it into respective ObjectId() format.