{"action":"created","issue":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1780","repository_url":"https://api.github.com/repos/MongoEngine/mongoengine","labels_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1780/labels{/name}","comments_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1780/comments","events_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1780/events","html_url":"https://github.com/MongoEngine/mongoengine/issues/1780","id":318439583,"number":1780,"title":"Dereferencing of ReferenceFields do not seem to work","user":{"login":"stratosgear","id":193463,"avatar_url":"https://avatars3.githubusercontent.com/u/193463?v=4","gravatar_id":"","url":"https://api.github.com/users/stratosgear","html_url":"https://github.com/stratosgear","followers_url":"https://api.github.com/users/stratosgear/followers","following_url":"https://api.github.com/users/stratosgear/following{/other_user}","gists_url":"https://api.github.com/users/stratosgear/gists{/gist_id}","starred_url":"https://api.github.com/users/stratosgear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stratosgear/subscriptions","organizations_url":"https://api.github.com/users/stratosgear/orgs","repos_url":"https://api.github.com/users/stratosgear/repos","events_url":"https://api.github.com/users/stratosgear/events{/privacy}","received_events_url":"https://api.github.com/users/stratosgear/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-27T14:51:50Z","updated_at":"2018-04-27T20:09:02Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\nFor a simple scenario like:\r\n\r\n```\r\nClass Post(Document):\r\n    title = StringField()\r\n    text = StringField()\r\n\r\nClass Page(Document):\r\n    posts = ListField(ReferenceField(Post))\r\n```\r\n\r\nI was originally thinking that `Page.objects.select_related()` **ought** to dereference all the `Post` objects but it is **not** working as I was expecting to.  \r\n\r\nFor example this does **not** have \"full\" Post objects:\r\n\r\n```\r\nreturn jsonify([p for p in Page.objects.select_related()])\r\n```\r\n\r\n*(I'm running it in Flask, as a response to a Vue application.  I would like to respond the full contents of each Post, so I will not have to make further requests later on to populate Post related fields (OK, i'm not using Page/Posts but other entities but the issue remains the same)*\r\n\r\nUnfortunately, a little loop trick suggested by @JohnAD on #1745 still does not work for me, ending up with an array of \"$oid\" instead of fully populated `Posts` objects\r\n\r\n```\r\npage_list = []\r\nfor page in Page.objects:\r\n    for post in page.posts: # getting the post should pull it (dereference it)\r\n        pass\r\n    page_list.append(page.to_json())\r\n```\r\n\r\nIs this a regression error (I'm running v0.15.0 with pymongo 3.5.1 on mongo 3.6.3) ?\r\n\r\nThanks.."},"comment":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/comments/385080598","html_url":"https://github.com/MongoEngine/mongoengine/issues/1780#issuecomment-385080598","issue_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1780","id":385080598,"user":{"login":"JohnAD","id":5799303,"avatar_url":"https://avatars1.githubusercontent.com/u/5799303?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnAD","html_url":"https://github.com/JohnAD","followers_url":"https://api.github.com/users/JohnAD/followers","following_url":"https://api.github.com/users/JohnAD/following{/other_user}","gists_url":"https://api.github.com/users/JohnAD/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnAD/subscriptions","organizations_url":"https://api.github.com/users/JohnAD/orgs","repos_url":"https://api.github.com/users/JohnAD/repos","events_url":"https://api.github.com/users/JohnAD/events{/privacy}","received_events_url":"https://api.github.com/users/JohnAD/received_events","type":"User","site_admin":false},"created_at":"2018-04-27T20:09:02Z","updated_at":"2018-04-27T20:09:02Z","author_association":"CONTRIBUTOR","body":"further details in #1745 "}}
{"actor":{"display_login":"JohnAD"}}