Follow ReferenceFields in EmbeddedDocuments with select_related

For the following structure:

    class Playlist(Document):
        items = ListField(EmbeddedDocumentField("PlaylistItem"))

    class PlaylistItem(EmbeddedDocument):
        song = ReferenceField("Song")

    class Song(Document):
        title = StringField()

this patch prevents the N+1 queries otherwise required to fetch all
the `Song` instances referenced by all the `PlaylistItem`s.
This commit is contained in:
Clay McClure
2014-06-19 19:33:46 -04:00
parent 4e7b5d4af8
commit 170693cf0b
3 changed files with 28 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ Changelog
Changes in 0.9.X - DEV
======================
- Follow ReferenceFields in EmbeddedDocuments with select_related #690
- Added preliminary support for text indexes #680
- Added `elemMatch` operator as well - `match` is too obscure #653
- Added support for progressive JPEG #486 #548