Commit Graph
4 Commits
Author SHA1 Message Date
Eric Timmons 68dc2925fb Add LazyReferenceField with dbref=True to embedded_document equality test 2019-12-15 20:21:22 -05:00
Eric Timmons 0d4e61d489 Add daewok to AUTHORS per contributing guidelines 2019-12-15 20:21:18 -05:00
Eric Timmons dc7b96a569 Make python value for LazyReferenceFields be a DBRef
Previously, when reading a LazyReferenceField from the DB, it was stored
internally in the parent document's _data field as an ObjectId. However, this
meant that equality tests using an enclosing EmbeddedDocument would not return
True when the EmbeddedDocument being compared to contained a DBRef or Document
in _data. Enclosing Documents were largely unaffected because they look at the
primary key for equality (which EmbeddedDocuments lack).

This makes the internal Python representation of a LazyReferenceField (before
the LazyReference itself has been constructed) a DBRef, using code identical to
ReferenceField.
2019-12-15 20:20:59 -05:00
Eric Timmons 50882e5bb0 Add failing test
Test that __eq__ for EmbeddedDocuments with LazyReferenceFields works as
expected.
2019-12-15 20:20:59 -05:00