{"action":"opened","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/99","labels_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/99/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/99/events","html_url":"https://github.com/elastic/elasticsearch-dsl-py/issues/99","id":60671256,"number":99,"title":"Cannot assign a Nested field attribute from an existing instance","user":{"login":"njoannin","id":3947618,"avatar_url":"https://avatars.githubusercontent.com/u/3947618?v=3","gravatar_id":"","url":"https://api.github.com/users/njoannin","html_url":"https://github.com/njoannin","followers_url":"https://api.github.com/users/njoannin/followers","following_url":"https://api.github.com/users/njoannin/following{/other_user}","gists_url":"https://api.github.com/users/njoannin/gists{/gist_id}","starred_url":"https://api.github.com/users/njoannin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njoannin/subscriptions","organizations_url":"https://api.github.com/users/njoannin/orgs","repos_url":"https://api.github.com/users/njoannin/repos","events_url":"https://api.github.com/users/njoannin/events{/privacy}","received_events_url":"https://api.github.com/users/njoannin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-11T14:57:11Z","updated_at":"2015-03-11T14:57:11Z","closed_at":null,"body":"Hmm, I'm not sure that title is very clear :( Best to go through an example...\r\n\r\nExample:\r\n\r\nHere's the class:\r\n\r\n```\r\n>>> class TestUser(DocType): \r\n...     email = String(index=\"not_analyzed\")\r\n...     friends = Nested(properties={\r\n...                         \"email\": String(index=\"not_analyzed\"),\r\n...                         \"name\": String()\r\n...     })\r\n...     class Meta:\r\n...         index = \"testing\"\r\n...         doc_type = \"test_users\"\r\n... \r\n>>> TestUser.init()\r\n```\r\n\r\nCreate a first instance of that class:\r\n\r\n```\r\n>>> t1 = TestUser(email=\"test@email.com\", friends=[{\"email\":\"other@email.com\", \"name\":\"Bob\"}], _id=1)\r\n>>> t1.save()\r\nTrue\r\n```\r\n\r\nNo problem. But now, create a new instance, without setting any attribute.\r\nThen, assign attributes, using the attributes set to the first instance:\r\n\r\n```\r\n>>> t2 = TestUser()\r\n>>> t2.email = t1.email\r\n>>> t2\r\n{'email': 'test@email.com'}\r\n```\r\n\r\nThe ```\r\nString```\r\n field works fine. But, not the ```Nested```\r\n field:\r\n\r\n```\r\n>>> t2.friends = t1.friends\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/Users/Nicolas/myproject/flask/lib/python3.3/site-packages/elasticsearch_dsl-0.0.4.dev0-py3.3.egg/elasticsearch_dsl/document.py\", line 94, in __setattr__\r\n  File \"/Users/Nicolas/myproject/flask/lib/python3.3/site-packages/elasticsearch_dsl-0.0.4.dev0-py3.3.egg/elasticsearch_dsl/utils.py\", line 410, in __setattr__\r\n  File \"/Users/Nicolas/myproject/flask/lib/python3.3/site-packages/elasticsearch_dsl-0.0.4.dev0-py3.3.egg/elasticsearch_dsl/field.py\", line 49, in to_python\r\n  File \"/Users/Nicolas/myproject/flask/lib/python3.3/site-packages/elasticsearch_dsl-0.0.4.dev0-py3.3.egg/elasticsearch_dsl/field.py\", line 98, in _to_python\r\nTypeError: type object argument after ** must be a mapping, not AttrList\r\n```\r\n\r\nI'm guessing this is a bug? Any suggestion for a workaround until it is fixed?\r\n"}}