Skip to content

Commit ebdd2d7

Browse files
committed
Fixed querying ReferenceField custom_id (MongoEngine#317)
1 parent 1ddf8b3 commit ebdd2d7

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44

55
Changes in 0.8.0
66
================
7+
- Fixed querying ReferenceField custom_id (#317)
78
- Fixed pickle issues with collections (#316)
89
- Added `get_next_value` preview for SequenceFields (#319)
910
- Added no_sub_classes context manager and queryset helper (#312)

mongoengine/fields.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,6 @@ def to_mongo(self, document):
853853
if not self.dbref:
854854
return document.id
855855
return document
856-
elif not self.dbref and isinstance(document, basestring):
857-
return ObjectId(document)
858856

859857
id_field_name = self.document_type._meta['id_field']
860858
id_field = self.document_type._fields[id_field_name]

0 commit comments

Comments
 (0)