{"action":"opened","number":1156,"pull_request":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1156","id":50302968,"html_url":"https://github.com/MongoEngine/mongoengine/pull/1156","diff_url":"https://github.com/MongoEngine/mongoengine/pull/1156.diff","patch_url":"https://github.com/MongoEngine/mongoengine/pull/1156.patch","issue_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1156","number":1156,"state":"open","locked":false,"title":"fix for reloading of strict with special fields","user":{"login":"paularmand","id":379288,"avatar_url":"https://avatars.githubusercontent.com/u/379288?v=3","gravatar_id":"","url":"https://api.github.com/users/paularmand","html_url":"https://github.com/paularmand","followers_url":"https://api.github.com/users/paularmand/followers","following_url":"https://api.github.com/users/paularmand/following{/other_user}","gists_url":"https://api.github.com/users/paularmand/gists{/gist_id}","starred_url":"https://api.github.com/users/paularmand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paularmand/subscriptions","organizations_url":"https://api.github.com/users/paularmand/orgs","repos_url":"https://api.github.com/users/paularmand/repos","events_url":"https://api.github.com/users/paularmand/events{/privacy}","received_events_url":"https://api.github.com/users/paularmand/received_events","type":"User","site_admin":false},"body":"The following throws an error:\r\n\r\n```\r\nimport pymongo as pm\r\nimport mongoengine as me\r\nimport pprint\r\n\r\n\r\ndb_name = \"test_database\"\r\ncollection_name = \"post\"\r\ncollection_name_items = \"post_items\"\r\n\r\n# get collections through pymongo\r\nclient = pm.MongoClient()\r\ndb = client[db_name]\r\n\r\n# insert a reference document\r\nposts = db[collection_name]\r\npost = {\"title\": \"Lunar eclipse\", \"body\": \"lorum ipsim and the rest\"}\r\nposts.insert_one(post)\r\n\r\n# insert the test document\r\nposts_items = db[collection_name_items]\r\npost_items = {\"title\": \"Items eclipse\", \"body\": \"lorum ipsim and the rest\", \"items\": [\"more lorem\", \"even more ipsum\"]}\r\nposts_items.insert_one(post_items)\r\n\r\n\r\nclass Post(me.Document):\r\n    meta = {\r\n        'strict': False\r\n    }\r\n    title = me.StringField(required=True, max_length=200)\r\n    body = me.StringField(required=True, max_length=2000)\r\n\r\n\r\nclass PostItems(me.Document):\r\n    meta = {\r\n        'strict': False\r\n    }\r\n    title = me.StringField(required=True, max_length=200)\r\n    body = me.StringField(required=True, max_length=2000)\r\n    items = me.StringField()\r\n\r\nme.connect(db_name, alias=\"default\")\r\npost_retrieved = Post.objects().first()\r\npprint.pprint(post_retrieved)\r\n\r\npost_items_retrieved = PostItems.objects().first()\r\npprint.pprint(post_items_retrieved)\r\nprint(\"should print items\")\r\nprint post_items_retrieved.items\r\n\r\npost_items_retrieved.reload()\r\nprint post_items_retrieved.items\r\n```\r\n\r\nthe trace:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"test.py\", line 49, in <module>\r\n    post_items_retrieved.reload()\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mongoengine/document.py\", line 606, in reload\r\n    delattr(self, field)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mongoengine/base/document.py\", line 145, in __delattr__\r\n    super(BaseDocument, self).__delattr__(*args, **kwargs)\r\nAttributeError: _reserved_items\r\n```\r\n\r\nThe pull request is resolves the issue by trying to get the field ```_reserved_items``` from ```_data``` as a fallback. \r\n\r\nIf you give an indication as to where (in which test class) I need to write the nose test for this issue, I'll do that. On my local platform ```python setup.py nosetests``` gives\r\n\r\n```\r\n742 tests run in 32.2 seconds. \r\n4 skipped (738 tests passed)\r\n```\r\n \r\n","created_at":"2015-11-10T19:58:41Z","updated_at":"2015-11-10T19:58:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1156/commits","review_comments_url":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1156/comments","review_comment_url":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1156/comments","statuses_url":"https://api.github.com/repos/MongoEngine/mongoengine/statuses/fb4e9c37728d330dc01baadc9fb2ab5c96d4566d","head":{"label":"paularmand:fix-reloading-strict","ref":"fix-reloading-strict","sha":"fb4e9c37728d330dc01baadc9fb2ab5c96d4566d","user":{"login":"paularmand","id":379288,"avatar_url":"https://avatars.githubusercontent.com/u/379288?v=3","gravatar_id":"","url":"https://api.github.com/users/paularmand","html_url":"https://github.com/paularmand","followers_url":"https://api.github.com/users/paularmand/followers","following_url":"https://api.github.com/users/paularmand/following{/other_user}","gists_url":"https://api.github.com/users/paularmand/gists{/gist_id}","starred_url":"https://api.github.com/users/paularmand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paularmand/subscriptions","organizations_url":"https://api.github.com/users/paularmand/orgs","repos_url":"https://api.github.com/users/paularmand/repos","events_url":"https://api.github.com/users/paularmand/events{/privacy}","received_events_url":"https://api.github.com/users/paularmand/received_events","type":"User","site_admin":false},"repo":{"id":45919960,"name":"mongoengine","full_name":"paularmand/mongoengine","owner":{"login":"paularmand","id":379288,"avatar_url":"https://avatars.githubusercontent.com/u/379288?v=3","gravatar_id":"","url":"https://api.github.com/users/paularmand","html_url":"https://github.com/paularmand","followers_url":"https://api.github.com/users/paularmand/followers","following_url":"https://api.github.com/users/paularmand/following{/other_user}","gists_url":"https://api.github.com/users/paularmand/gists{/gist_id}","starred_url":"https://api.github.com/users/paularmand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paularmand/subscriptions","organizations_url":"https://api.github.com/users/paularmand/orgs","repos_url":"https://api.github.com/users/paularmand/repos","events_url":"https://api.github.com/users/paularmand/events{/privacy}","received_events_url":"https://api.github.com/users/paularmand/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paularmand/mongoengine","description":"A Python Object-Document-Mapper for working with MongoDB","fork":true,"url":"https://api.github.com/repos/paularmand/mongoengine","forks_url":"https://api.github.com/repos/paularmand/mongoengine/forks","keys_url":"https://api.github.com/repos/paularmand/mongoengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paularmand/mongoengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paularmand/mongoengine/teams","hooks_url":"https://api.github.com/repos/paularmand/mongoengine/hooks","issue_events_url":"https://api.github.com/repos/paularmand/mongoengine/issues/events{/number}","events_url":"https://api.github.com/repos/paularmand/mongoengine/events","assignees_url":"https://api.github.com/repos/paularmand/mongoengine/assignees{/user}","branches_url":"https://api.github.com/repos/paularmand/mongoengine/branches{/branch}","tags_url":"https://api.github.com/repos/paularmand/mongoengine/tags","blobs_url":"https://api.github.com/repos/paularmand/mongoengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paularmand/mongoengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paularmand/mongoengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/paularmand/mongoengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paularmand/mongoengine/statuses/{sha}","languages_url":"https://api.github.com/repos/paularmand/mongoengine/languages","stargazers_url":"https://api.github.com/repos/paularmand/mongoengine/stargazers","contributors_url":"https://api.github.com/repos/paularmand/mongoengine/contributors","subscribers_url":"https://api.github.com/repos/paularmand/mongoengine/subscribers","subscription_url":"https://api.github.com/repos/paularmand/mongoengine/subscription","commits_url":"https://api.github.com/repos/paularmand/mongoengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/paularmand/mongoengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/paularmand/mongoengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/paularmand/mongoengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/paularmand/mongoengine/contents/{+path}","compare_url":"https://api.github.com/repos/paularmand/mongoengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paularmand/mongoengine/merges","archive_url":"https://api.github.com/repos/paularmand/mongoengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paularmand/mongoengine/downloads","issues_url":"https://api.github.com/repos/paularmand/mongoengine/issues{/number}","pulls_url":"https://api.github.com/repos/paularmand/mongoengine/pulls{/number}","milestones_url":"https://api.github.com/repos/paularmand/mongoengine/milestones{/number}","notifications_url":"https://api.github.com/repos/paularmand/mongoengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paularmand/mongoengine/labels{/name}","releases_url":"https://api.github.com/repos/paularmand/mongoengine/releases{/id}","created_at":"2015-11-10T15:13:52Z","updated_at":"2015-11-10T15:13:54Z","pushed_at":"2015-11-10T19:44:36Z","git_url":"git://github.com/paularmand/mongoengine.git","ssh_url":"git@github.com:paularmand/mongoengine.git","clone_url":"https://github.com/paularmand/mongoengine.git","svn_url":"https://github.com/paularmand/mongoengine","homepage":"http://mongoengine.org","size":13616,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"MongoEngine:master","ref":"master","sha":"2c282f955025c0c8d339c5ae539032ea3f544f84","user":{"login":"MongoEngine","id":1502485,"avatar_url":"https://avatars.githubusercontent.com/u/1502485?v=3","gravatar_id":"","url":"https://api.github.com/users/MongoEngine","html_url":"https://github.com/MongoEngine","followers_url":"https://api.github.com/users/MongoEngine/followers","following_url":"https://api.github.com/users/MongoEngine/following{/other_user}","gists_url":"https://api.github.com/users/MongoEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/MongoEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MongoEngine/subscriptions","organizations_url":"https://api.github.com/users/MongoEngine/orgs","repos_url":"https://api.github.com/users/MongoEngine/repos","events_url":"https://api.github.com/users/MongoEngine/events{/privacy}","received_events_url":"https://api.github.com/users/MongoEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":3626679,"name":"mongoengine","full_name":"MongoEngine/mongoengine","owner":{"login":"MongoEngine","id":1502485,"avatar_url":"https://avatars.githubusercontent.com/u/1502485?v=3","gravatar_id":"","url":"https://api.github.com/users/MongoEngine","html_url":"https://github.com/MongoEngine","followers_url":"https://api.github.com/users/MongoEngine/followers","following_url":"https://api.github.com/users/MongoEngine/following{/other_user}","gists_url":"https://api.github.com/users/MongoEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/MongoEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MongoEngine/subscriptions","organizations_url":"https://api.github.com/users/MongoEngine/orgs","repos_url":"https://api.github.com/users/MongoEngine/repos","events_url":"https://api.github.com/users/MongoEngine/events{/privacy}","received_events_url":"https://api.github.com/users/MongoEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MongoEngine/mongoengine","description":"A Python Object-Document-Mapper for working with MongoDB","fork":false,"url":"https://api.github.com/repos/MongoEngine/mongoengine","forks_url":"https://api.github.com/repos/MongoEngine/mongoengine/forks","keys_url":"https://api.github.com/repos/MongoEngine/mongoengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MongoEngine/mongoengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MongoEngine/mongoengine/teams","hooks_url":"https://api.github.com/repos/MongoEngine/mongoengine/hooks","issue_events_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/events{/number}","events_url":"https://api.github.com/repos/MongoEngine/mongoengine/events","assignees_url":"https://api.github.com/repos/MongoEngine/mongoengine/assignees{/user}","branches_url":"https://api.github.com/repos/MongoEngine/mongoengine/branches{/branch}","tags_url":"https://api.github.com/repos/MongoEngine/mongoengine/tags","blobs_url":"https://api.github.com/repos/MongoEngine/mongoengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MongoEngine/mongoengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MongoEngine/mongoengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/MongoEngine/mongoengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MongoEngine/mongoengine/statuses/{sha}","languages_url":"https://api.github.com/repos/MongoEngine/mongoengine/languages","stargazers_url":"https://api.github.com/repos/MongoEngine/mongoengine/stargazers","contributors_url":"https://api.github.com/repos/MongoEngine/mongoengine/contributors","subscribers_url":"https://api.github.com/repos/MongoEngine/mongoengine/subscribers","subscription_url":"https://api.github.com/repos/MongoEngine/mongoengine/subscription","commits_url":"https://api.github.com/repos/MongoEngine/mongoengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/MongoEngine/mongoengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/MongoEngine/mongoengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/MongoEngine/mongoengine/contents/{+path}","compare_url":"https://api.github.com/repos/MongoEngine/mongoengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MongoEngine/mongoengine/merges","archive_url":"https://api.github.com/repos/MongoEngine/mongoengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MongoEngine/mongoengine/downloads","issues_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues{/number}","pulls_url":"https://api.github.com/repos/MongoEngine/mongoengine/pulls{/number}","milestones_url":"https://api.github.com/repos/MongoEngine/mongoengine/milestones{/number}","notifications_url":"https://api.github.com/repos/MongoEngine/mongoengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MongoEngine/mongoengine/labels{/name}","releases_url":"https://api.github.com/repos/MongoEngine/mongoengine/releases{/id}","created_at":"2012-03-05T12:10:20Z","updated_at":"2015-11-09T22:01:32Z","pushed_at":"2015-11-10T15:16:02Z","git_url":"git://github.com/MongoEngine/mongoengine.git","ssh_url":"git@github.com:MongoEngine/mongoengine.git","clone_url":"https://github.com/MongoEngine/mongoengine.git","svn_url":"https://github.com/MongoEngine/mongoengine","homepage":"http://mongoengine.org","size":13616,"stargazers_count":1132,"watchers_count":1132,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":669,"mirror_url":null,"open_issues_count":264,"forks":669,"open_issues":264,"watchers":1132,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1156"},"html":{"href":"https://github.com/MongoEngine/mongoengine/pull/1156"},"issue":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1156"},"comments":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1156/comments"},"review_comments":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1156/comments"},"review_comment":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1156/commits"},"statuses":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/statuses/fb4e9c37728d330dc01baadc9fb2ab5c96d4566d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":11,"deletions":6,"changed_files":1}}